STACK
The stack is a data structure that operates as a last-in-first-out (LIFO) structure
LIFO (Last In First Out)
Segment | Address | Contents
--------|----------------------------------|------------------------------------------
Stack | ^ | Local variables, function params
| | |
| 0xaaaaaaaa (just an example) |
| ... |
| +------------------------------+ | Each frame is specific to a procedure.
| | | | Each frame contains the local variables
| | Frame 2 | | of the procedure, the return address, and
| | | | a backup of the input parameters, or a
| +------------------------------+ | copy of certain registers.
| +------------------------------+ |
| | | | The frame 1 normally corresponds to the
| | Frame 1 | | 'main' function.
| | | |
| +------------------------------+ |
| 0xffffffff |
--------|----------------------------------|-----------------------------------------Last updated