The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
To: tuhs@minnie.tuhs.org
Cc: jnc@mercury.lcs.mit.edu
Subject: Re: [TUHS] [tuhs] PDP-11 and early Unix
Date: Mon, 14 Mar 2022 12:56:04 -0400 (EDT)	[thread overview]
Message-ID: <20220314165604.4889918C075@mercury.lcs.mit.edu> (raw)

    > 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.

right.

	Noel


             reply	other threads:[~2022-03-14 16:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 16:56 Noel Chiappa [this message]
2022-03-14 18:00 ` Clem Cole
2022-03-14 19:03   ` Angelo Papenhoff
  -- strict thread matches above, loose matches on Subject: below --
2022-03-14 20:38 Noel Chiappa
2022-03-14 20:22 Noel Chiappa
2022-03-14 12:58 Nelson H. F. Beebe
2022-03-14 14:59 ` Ron Natalie
2022-03-14 15:13   ` Clem Cole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220314165604.4889918C075@mercury.lcs.mit.edu \
    --to=jnc@mercury.lcs.mit.edu \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).