x86 (32-bit) vs x64 (64-bit)

General comparisons

x86
x64

How are arguments passed to functions in an ELF (Linux) architecture?

Passed on the stack

Passed via registers

Which register is used to return a value from a C function?

eax register

rax register

Maximum register size

4 byte (32 bit)

8 byte (64 bit)

...

Registers

As mentioned before, the x64 architecture has the 8 byte registers, while x86 can only access up to the 4 byte registers. There also exists 2 byte and a single byte register, as defined in the table below:

Taken directly from source

Taking the 8 byte register rax as an example, we can see that the lower 4, 2 and single byte(s) register will be the eax, ax and al respectively.

  • eax: Lower 4 bytes of the rax register

  • ax: Lower 2 bytes of the rax register

  • al: Last byte of the rax register

Last updated