I have this assembly code:
movl -4(%ebp),%eax
What does the -4
before the (%ebp)
mean?
The -4 is a constant offset to the pointer held by the register. This code reads the long value at ebp - 4
and stores it in eax
. This is AT&T syntax; the Intel syntax for the same instruction would be mov eax, dword ptr [ebp-4]
.