4 ms·
This is an old article from the early 90s and I believe it may have been the first public mention of this fact about the x86 encoding, although no doubt many ha
by userbinator 5y ago
This is an old article from the early 90s and I believe it may have been the first public mention of this fact about the x86 encoding, although no doubt many have independently "discovered" it before --- especially in the times when microcomputer programming consisted largely of writing down Asm on paper and then hand-assembling the bytes into memory using something like a hex keypad.
All of these are features inherited from the 8080/8085/Z80.
Here are the corresponding opcode tables in octal:
https://dercuano.github.io/notes/8080-opcode-map.html https://dercuano.github.io/notes/8080-opcode-map.html
http://www.righto.com/2013/02/8085-instruction-set-octal-table.html http://www.righto.com/2013/02/8085-instruction-set-octal-tab...
http://www.z80.info/decoding.htm http://www.z80.info/decoding.htm
- klelatti 5y agoThanks for these links - very interesting. Astonishing to think that we can see traces of the 8008 still today and that it wasn’t actually an Intel designed ISA (came from CTC / Datapoint).
- kens 5y agoThe Datapoint 2200, the source of the 8008 instruction set, is an interesting machine. The CPU was built from TTL chips. To decode instructions, they used decimal BCD decoder chips, specifically the 7442. But they'd use them as octal decoder chips, only using 8 outputs. The Datapoint 2200 documentation gave the opcodes in octal, so they were clearly thinking in octal. The 8008 documentation, however, didn't use octal or hexadecimal. The opcodes were given in binary, but grouped in 3 bits, octal style, e.g. 10 111 010. (They didn't specify opcodes in octal or hex!) I think the 8008 was right at the time where octal was on the way out and hexadecimal was taking over. (The 8008 assembler manual uses both octal and hexadecimal, but hexadecimal primarily.) The Intel 8080 still specified the instruction set in binary, not octal or hexadecimal. The 8085 had opcodes in binary in a 1983 manual, but now split with a line into 4-bit chunks (i.e. hexadecimal-style). And then an appendix gave the opcodes in hexadecimal. (Just some random history.)
- klelatti 5y agoDo you know if Federico Faggin copied the logic design of the 2200 or implemented the ISA using his own design?
- Tuna-Fish 5y agoHis own. There would have been no way to fit the logic design of the 2200 on a chip, both because of lack of metal layers, and because the 2200 was designed to be frugal in how many chips it used, using off-the-shelf chips, which is very different from being frugal in the amount of transistors you use when you have freedom to lay out each one by hand.
- kens 5y agoThe implementation of the 8008 is completely different from the 2200 (as is Texas Instruments' forgotten TMX 1795 implementation). It would be extremely inefficient to copy the TTL implementation, since that depended on what chips were available. But the biggest difference is that the Datapoint 2200 was a serial machine that used serial shift-register memory while the 8008 had a "normal" 8-bit datapath.
- klelatti 5y agoThanks - even in 1972 we had multiple radically different implementations of the same ISA!
- kens 5y agoOne thing I forgot to mention: the 6502 microprocessor also uses groups of 3 bits in its instructions. However, they group them in the "wrong" way, aaabbbcc, so looking at the instructions in octal doesn't help you at all. Also, after using the Xerox Alto, which uses 16-bit words, I realized that octal is terrible. The problem is that if you're looking at two bytes in a word, the values make no sense in octal. For example, the characters "AB" form the hex word 0x4142, while "BA" forms 0x4241; the two letters are clear. But in octal, "AB" is 0o40502 and "BA" is 0o41101; the two letters turn into unrecognizable numbers.
- pvg 5y agoI kind of doubt it was actually the first. It's definitely an interesting/cute thing to notice and write up but I think the weird longevity of this particular piece owes more to the pioneering clickbaity framing (x86 is not really an octal machine, it's not surprising that people 'hadn't noticed' because obviously they had, etc) than the observations themselves.
- nielsbot 5y agoThe sibling comments disagree with you
- pvg 5y agoI’m not seeing any disagreement in sibling or other comments
- monocasa 5y agoThe comment by kens explains how the Datapoint 2200 both documented the design of the ISA in octal and used collections of three bits to decode at the fairly high TTL chip level. https://news.ycombinator.com/item?id=30409100#30409889 https://news.ycombinator.com/item?id=30409100#30409889
- pvg 5y agoThe fact that instructions have some 'octal' structure doesn't make the thing an 'octal machine' and as importantly, a Datapoint 2200 is not an x86. The x86 is not an octal machine.
- monocasa 5y ago> The fact that instructions have some 'octal' structure doesn't make the thing an 'octal machine' Basic concepts like the 8 GPRs are rooted in it's octal decoding roots. MOD/RM is still octal decoded, SIB is still octal decoded, etc. These fields aren't just three bits long, but also aligned to a three bit boundary within the byte being decoded. > and as importantly, a Datapoint 2200 is not an x86. The x86 is not an octal machine. The x86 traces its lineage to that and the points still hit. For instance, even when they added more registers in x86_64, it's still a three bit bank with simply a new prefix to select whether it's referring to the top or bottom 8 register bank out of now 16 total registers. There's some awkward places where you can't address different 8 register banks in the way you'd want to from an encoding perspective because of these continued restrictions going back to the Datapoint 2200. Having written the HDL for a simple x86_64 decoder, it is very much still an octal machine.
- kragen 5y agoI thought the 8008 manuals used hex, but, as kens points out in https://news.ycombinator.com/item?id=30409889 https://news.ycombinator.com/item?id=30409889, the Datapoint manuals used octal. My notes on the 8080 are at https://dercuano.github.io/notes/8080-opcode-map.html https://dercuano.github.io/notes/8080-opcode-map.html.