[ih] byte order, was Octal vs Hex, not Re: Dotted decimal notation

Clem Cole clemc at ccc.com
Wed Dec 30 14:21:15 PST 2020


My apologies -- this is a bit more suited to the COFF mailing list than IH,
but the questions/comment came here.  Apologies to the moderators if I am
taking this a tad to far...

On Wed, Dec 30, 2020 at 2:55 PM Bill Ricker <bill.n1vux at gmail.com> wrote:

> Bell Labs' Unix and C brought Octal/Decimal/Hex parity to the PDP-11 (and
> Vax11/780 thereafter).
>
Hrrmpt --- yes eventually but not originally, more in a minute....


> (Whether 'B' on the PDP-7 proto-Unix had Hex constants, I haven't a clue.)
>
It did not.   Only octal, pls type 'B Tutorial Kernighan' into your
favorite search engine (the file is called btut.pdf in the wild -- there
are versions including the original roff (not nroff or troff BTW) of the
document if you go hunting.


> (And IDK if any DEC OS or Language products gave Hex first-class standing
> before that?)
>
Yes, because code had to come from other manufacturers' products to TLG was
pretty good about picking up things that IBM support.  Somebody like Leslie
Kling (who managed TLG for years) might remember [but thanks to CV-19 our
weekly lunches have not occurred since last Feb, so I cann't ask any of the
old TLG folks].  But you are correct, it was with Vax DEC started to use
hex more freely -- it was a bit of a war between the 18/36-bit folks and
the 32-bit, the 11 folks were sort of in the middle.

As noted, the 11 was a 16-bit system although all the important concepts in
the processor handbook are described in terms of octal [like device
addresses - see Page A6 of old processor handbook].   As was pointed out by
other folks, the instruction coding is all in threes also.  There are 8
registers, *etc*....  Octal was pretty natural for it and most PDP-11
programmers (as was noted by the OP) tended to use octal for Macro-11 (I
certainly did and I had programmed the 360 'BAL' and learned hex arithmetic
before I started PDP-11 or PDP-10 hacking for that matter) but ...

The Vax at 32-bits was when DEC started to be more hex oriented and really
was an interesting thing to see the differences in the docs and the
schematics etc...   and more difficult to live through.  Macro-32 it starts
to change, as octal just was not as natural.

As for BTL, C/Unix, *etc*...   as one of the folks that very much lived
that world.  Ken and Dennis very much used octal for everything.   If you
look at the kernel or any of the compiler sources in the TUHS archives (or
read the Lions book), you rarely see hex in anything.   It's almost 100%
octal.  In fact, if you should an old Unix jockey like me the address of
certain CSRs in hex, few of us would naturally recognize the address in the
CSR space or what it was pointing too, whereas anything in C code being
assigned to 077wxyz sure looks like one to me.

Sadly, we can't ask Dennis, but Ken, Doug, or Mike Lesk might remember when
Dennis added hex constants (which I'll try to follow up in email and find
out if they remember anything).  IIRC, the \x hex constants were there in
Dennis compiler before the Vax, but I don't remember any code that used it
until the V32 port and then only in things that really had to deal with a
Vaxism, most PDP-11 folks still used octal of they had bit maps.   If I
have a chance I'll try to take a look at the Fifth Edition, Sixth, and
Seventh Editions of his compiler and see if Dennis had them there [Fifth
was my first C compiler].

ᐧ



More information about the Internet-history mailing list