3 ms·
Most people list the registers in alphabetic order, but numerically they are encoded with the B registers in the 4th place: EAX=0, ECX=1, EDX=2, EBX=3, ... If
by xscott 7y ago
Most people list the registers in alphabetic order, but numerically they are encoded with the B registers in the 4th place: EAX=0, ECX=1, EDX=2, EBX=3, ...
If you ever find yourself writing an AMD-64 assembler, it really feels like you're digging through archaeology with all of the weird quirks you need to implement. The SSE, AVX, and AVX-512 encodings add even more levels of, "why did they do that?!?" which don't make much sense except in the context of history.
- userbinator 7y agobut numerically they are encoded with the B registers in the 4th place I've never seen an authoritative answer for that but I believe it comes from the fact that in the 16-bit addressing modes, BX is the only one of the 4 ABCD registers that can be used to address memory, and the circuitry for decoding is very slightly simpler to detect two 1 bits than one 1 and one 0 bit. The 4 other registers are, in order, SP BP SI DI. which don't make much sense except in the context of history That can be said for a lot of things...