During each function call, the following are pushed onto the stacked in order:
- The caller pushes arguments in reverse order onto the stack so that the first argument is the closest to the callee’s function frame (soon to be created).
- The
call
instruction pushes address of the caller’s next instruction as the return address (to which the base pointer points to) - The callee typically backs up the caller’s base pointer on stack.
- (local variables follow)
In a debugger’s dump view, the function arguments can be viewed in order if the stack is displayed from low address to high address.