What does "push ebp" mean in x86 assemby? [duplicate]
I disassembled an .exe file and got this as its first line.
push ebp
- What does it mean?
- Why
ebp
? - Does it have anything to do with
pop
command? even though I don't see it in the disassembly!
push ebp
just means pushing whatever is in register ebp
onto the stack. ebp
stores the stack pointer by convention.
This is generally used to establish a stack frame, followed by
mov ebp, esp
It pushes the value of the EBP register on the stack, and is most commonly used to set up a stackframe. Pop
retrieves a value from the stack.
The push instruction saves the value of a register onto the stack. The value can later be retrieved using a pop-instruction.
Wikipedia Stack (data structure): http://en.wikipedia.org/wiki/Stack_%28data_structure%29
精彩评论