I've been trying to understand how my assembly code is being loaded in RAM,so I ran this code on a x86_64 cpu:
section .text
global main
main:
push 50
push 64
push 0x10
mov eax, 60
syscall
after looking at how the first 4 lines are loaded in RAM using gdb I got the result:
0x401000 <main>: 0x406a326a 0x3cb8106a
since my CPU is little endian, it's natural for the lines to be flipped(hence why line 2 comes before line 1) so from that push would be 0x6a and mov would be 0xb8(not sure).
My question is, why are they bundled up into 32 bit words? I thought the output would be something like:
0x3cb8106a 0x406a326a
as it would make sense in a 64 bit little endian machine.