Registers 32 and 64 bits
Posted: Sun Sep 04, 2022 6:33 pm
(Google translate)
Can you please explain why on a 64-bit system a write to a 32-bit register completely clears the 64-bit register and not just the lower 32-bit part? While writing to a 16-bit or 8-bit register does not clear the 64-bit register.
For example
RAX = FFFFFFFFFFFFFF
mov al,11 ---> RAX = FFFFFFFFFFFFFF11
mov ax,1111 ---> RAX = FFFFFFFFFFFF1111
mov eax,11111111 ---> RAX = 0000000011111111 - ?
Can you please explain why on a 64-bit system a write to a 32-bit register completely clears the 64-bit register and not just the lower 32-bit part? While writing to a 16-bit or 8-bit register does not clear the 64-bit register.
For example
RAX = FFFFFFFFFFFFFF
mov al,11 ---> RAX = FFFFFFFFFFFFFF11
mov ax,1111 ---> RAX = FFFFFFFFFFFF1111
mov eax,11111111 ---> RAX = 0000000011111111 - ?