<<< | Index | The Stack Segment and .STACK directive >>> |
A stack is an area of memory for storing data temporarily.
Unlike other segments that store data starting from low memory, the stack stores data starting from high memory.
The data is said to be pushed onto, and popped from the top of the stack.
The stack gets its name from its similarity to the spring-loaded plate holders in cafeterias: you add and remove plates from only the top of the stack.
To retrieve the third plate, you must remove (pop) the first two plates.
Stacks are often referred to as LIFO buffers, from their last-in-first-out operation.
A program continually uses its stack to temporarily store and preserve return addresses, procedure arguments, memory data, flags, and registers.
<<< | Index | The Stack Segment and .STACK directive >>> |