x86_64 registers rax/eax/ax/al overwriting full register contents [duplicate]
This question already has an answer here: Why do x86-64 instructions on 32-bit registers zero the upper part of the full 64-bit register? 2 answers As it is widely advertised, modern x86_64 processors have 64-bit registers that can be used in backward-compatible fashion as 32-bit registers, 16-bit registers and even 8-bit registers, for example: 0x1122334455667788 ================ rax (64 bits) ======== eax (32 bits) ==== ax (16 bits) == ah (8 bits) == al (8 bits) Such a scheme may be taken literally, i.e. one can always access only the part of the register using a designated name for reading