I've compiled the following code (GCC 9.1, x64)
0: mov eax,0x3
5: mov ebx,0x4
a: add eax,ebx
c: sub eax,ebx
And I've got the following binary code (hex view): B803000000BB0400000001D829D8
Disassembly says that I have the following accordance:
0: b8 03 00 00 00 mov eax,0x3
5: bb 04 00 00 00 mov ebx,0x4
a: 01 d8 add eax,ebx
c: 29 d8 sub eax,ebx
My questions are:
How does CPU understand how many bytes he should load to the register: 5 bytes (as at lines 0
and 1
) or 2 bytes (as ay lines a
and c
)?
According to the hex representation CPU uses big endian to store numbers 3
and 4
. Am I correct?