0

I have this assembly code:

movl -4(%ebp),%eax

What does the -4 before the (%ebp) mean?

Jester
  • 56,577
  • 4
  • 81
  • 125
Raghad
  • 53
  • 1
  • 1
  • 12

1 Answers1

2

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].

zneak
  • 134,922
  • 42
  • 253
  • 328