Page 1 of 1

Registers 32 and 64 bits

Posted: Sun Sep 04, 2022 6:33 pm
by AlexS
(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 - ?

Re: Registers 32 and 64 bits

Posted: Mon Sep 05, 2022 6:42 am
by Paul44
^ see here: [ [Link] ]
(stackoverflow is my preferred source for this kind of info btw)