[TUHS] [tuhs] PDP-11 and early Unix

Noel Chiappa jnc at mercury.lcs.mit.edu
Tue Mar 15 02:56:04 AEST 2022

    > From: "Nelson H. F. Beebe"

    > there is a nice compact history of the PDP-11 and early Unix at this
    > new article:

Not a bad artcle, but it had a number of minor errors, which I found irritating.
They should have gotten an expert to proof it.

Here are some:

  registers could access any other register - as well as memory or direct
  data - using one of the six different addressing modes

I think 'instruction' may have been meant for the first "register"; as
written it makes on sense. (Unlike the PDP-10, in the PDP-11, a register
can't address another register.) Oh, and there are eight addressing modes.

   use of labels instead of hard-coded addresses makes it easier to
   program and makes the code relocatable in memory

I'm not sure whether the writer knows the difference between 'PC-relative
addressing' (a PDP-11 feature; code that will run at any address, without
_any_ changes to the binary) and 'relocatable binary (which uses labels, as he
describes). - but is not PDP-11 specific.

  The program counter can be accessed like any of the other registers ... The
  program counter is intended to support jump, branching, and other control
  flow instructions.

Uh, no. It's not clear _exactly_ what was meant here, but... having the PC as
a general register is for PC-relative addressing of operands, immediate data,
and absolute addressing of operands. Jumps, branches, etc don't use the fact
that the PC is a general register.

  These are the key advantages of assembly programming over high-level
  languages - assembler code always runs faster and uses less memory.

Not really, with modern compilers.

  The number above represents -2.

A commenter caught this one.

  Just use a $ to represent a decimal number

In UNIX assembler, "$" means 'immediate data'; a trailing 
"." means decimal.

And a tip of the hatly hat for getting this:

  Although the ++ and - operators in C are equivalents of DEC and INC
  instructions, they were inspired by an addressing mode in the PDP-7.



More information about the TUHS mailing list