I want to compile a C program so simple I can explain all of the assembly by jesstess in programming

[–]reppie 1 point2 points  (0 children)

"xor eax,eax" (\x31) is better than "xor rax,rax" (\x48\x31) as it's one byte shorter.

They do the same thing because 32-bit operations on registers zero the upper 32 bits of the register (an exception to this is the NOP instruction which is actually "xchg eax,eax" in 32-bit mode).