Ben Bacarisse <ben.use...@bsb.me.uk>: > bartc <b...@freeuk.com> writes: >> On 11/05/2018 01:25, Marko Rauhamaa wrote: >>> I think octal is a historical relic from a time when people weren't >>> yet comfortable with hexadecimal. >> >> It's a relic from when machines had word sizes that were multiples of >> three bits, or were divided up on 3-bit boundaries. > > It got into C via B and B was often used on machine with a word size > that was a multiple of three. But octal was very useful on 16-bit > PDP-11s which is probably why it was kept. The PDP-11 has 8 registers > and uses 3 bits to specify the addressing mode and many instructions > use the top bit to indicate a variation such as word or byte > operation. The result is that you'd never choose to use hex to look at > PDP-11 code. That familiarity with octal must have played a bit part > in deciding to include it in C.
It may have been the other way round: people were comfortable with octal, which led to seeing three-bit fields everywhere and even designing CPUs accordingly. Four-bit fields were used for BCD, but I'm guessing using letters as digits felt awkward among computer people for a long time. Marko -- https://mail.python.org/mailman/listinfo/python-list