After function f executes
pushl %ebp movl %esp, %ebp subl $8, %esp
The stack frame for f contains
- space for two integers at -4(%ebp) and -8(%ebp)
- the saved %ebp value (frame pointer for main):
low memory address | Text (compiled, linked code) |
Global Data | |
heap area | |
(%esp) |
(top of f's stack frame) f's stack frame |
(%ebp) | main's saved %ebp value |
4(%ebp) | return address in main's code |
main's stack frame |