ebp
is not the stack pointer, that's esp
. ebp
is customarily used as frame pointer, so depending on how it was set up it may indeed be passing that 5
as argument. Or it may just be storing it in a local variable.
Also, it might not be possible to tell whether it's a local or a function argument without knowing the function itself:
int x = 5;
foo();
may generate the same code as foo(5);
The frame pointer is used to point at the beginning of the stack area for the current function and has to be set up by the function itself in the prologue. Arguments are above it (positive offsets) locals are below it (negative offsets). Note that in 32 and 64 bit mode (on x86) you don't really need it because you can address relative to the stack pointer esp
directly. Still, under some circumstances it may be useful, such as for debugging purposes.