If you just want to access the lower 8 bits of eax, use al:
mov dl, al
You can access the lower 8 bits, 16 bits, or 32 bits of each general register by changing the letters at the beginning or end. For register eax, using eax, use all 32 bits, ax the lower 16 bits, and al the lower 8 bits. The equivalent for ebx is ebx, bx and bl respectively, etc.
Please note that if you change the lower 16 or 8 bits of the register, the upper bits do not change. For example, if you load everything in eax, then load zero in al, then the lower 8 bits of eax will be zeros, and the higher 24 bits will be ones.
mov eax, -1 ; eax is all ones mov al, 0 ; higher 24 bits are ones, lower 8 bits are zeros
Michael williamson
source share