(Part 9)
The Stack
Stack is an area of memory for keeping temporary data. Stack is
used by CALL instruction to keep return address for procedure, RET
instruction gets this value from the stack and returns to that offset. Quite
the same thing happens when INT instruction calls an interrupt, it stores
in stack flag register, code segment and offset. IRET instruction is used to
return from interrupt call.
We can also use the stack to keep any other data,
there are two instructions that work with the stack:
PUSH - stores 16 bit value in the stack.
POP - gets 16 bit value from the stack.