x86cpu-architecturecpu-registers

Difference between low and high 8-bit registers; do their values use bits in opposite bit-endian order?


"AH-DH"
The high bit AH, BH, CH, and DH registers.
"AL-DL"
The low bit AL, BL, CL, and DL registers.

(editor's note: the actual manual says "high 8-bit", in the 2013 version linked from an answer.)

It's quoted from AMD64 volume 1, also I have seen that in Intels programmer manual.
I don't clearly understand what does it mean. Does it have anything to do with endian order? Since both amd and intel microprocessors are little-endian order.

Can it be explained as:
AH: 0 0 0 0 0 0 1 0
Is read from the first bit so it returns: 2 (in decimal)
But the same value in
AL: 0 0 0 0 0 0 1 0
Is read from the end and it returns: 64 (in decimal)


Solution

  • AH is the greater half of AX, AL is the lesser half, and similarly for the B,C, and D registers. Because we are directly specifying the high order bits, or the low order bits, rather than just asking for whatever comes first, endianness doesn't really come into play.

             AX = 0x288
     ________|________
    /                 \
    0000 0010 1000 1000
    \_______/ \_______/
     AH=0x2    AL=0x88