4 ms·
That's because Intel made the 8086 kind-of-sort-of backwards compatible with the 8080; it had six 8-bit registers (A Flags B C D E) plus a 16-bit register pair
by kiwidrew 6y ago
That's because Intel made the 8086 kind-of-sort-of backwards compatible with the 8080; it had six 8-bit registers (A Flags B C D E) plus a 16-bit register pair (H L), in that order.
AL corresponds to the 8080's A register and AH to the flags (which is also why the LAHF and SAHF instructions exist). CX corresponds to B+C and DX corresponds to D+E. Finally, BX is the 8086 equivalent of the 8080's pointer register HL.
(The 8086 didn't use the same opcodes as the 8080 but it was designed this way so that a simple translator could 'convert' existing 8080 code.)
- blueflow 6y agoWhy would the 8086 encoding be inspired from the 8080 when these two are generally not meant to be compatible in terms of their encoding? There is no gain from any of that. This is like a urban legend that i have never found the source for. I stopped believing it after learning that the 8080 encoding order is BCDEHLMA, with the accumulator being last at position 7.