4 The non-negative end of the frame
With all the conventions that we have introduced so far, by the time the frame pointer is initialized in a subroutine, we’ll
have the following items (expressed as based operands in AT&T format):
- 0(%ebp): the old frame pointer saved on the stack. This is the last item pushed on the stack before the frame
pointer becomes a snapshot of the stack pointer.
- 4(%ebp): the return address pushed by the call instruction executed by the caller.
- 8(%ebp): the first parameter of the invocation.
- 8+param1size(%ebp) the second parameter, assume param1size is the size (in bytes) of the first parameter.
- 8+param1size+param2size(%ebp): the third parameter of the invocation. param2size is the size of the second
parameter.
- And so on.