Consider this x86 assembly code:
section .data
foo:
mov ebx, [boo]
mov [goo], ebx
goo:
mov eax, 2
mov eax, 3
ret
boo:
mov eax, 4
mov eax, 5
ret
What exactly is going on here? When I dereference [boo] and mov it to [goo] what exactly am I moving there? Just one command? The ret as well?
Follow-up questions:
- Does dereferencing a label give me an address? Or the machine code for the first command in the label?
- If it's a machine code - how can it possibly be more than one command? Aren't all commands essentially 32-bit (even if not all bits are used)?
- Bottom line - will
eaxhave a value of 3 or 5 at the end?