When an interrupt request occurs, the stack is used as a place to temporarily save the flags of the program and the value of the PC that were running until just before the interrupt occurred.
After the interrupt processing is completed, the information such as the flags saved in the stack is restored, and the continuation of the suspended program is executed.
The stack pointer manages the stack, and indicates the address where the PC and the flag are saved.
The data to be put in and out of the stack is managed using the FILO (First-in Last-out) method, in which the data stored first is taken out later.
Storing the data in this stack is called "Push", and reading the data from this stack is called "Pop".
The stack pointer is advanced by "Push", and returned by "Pop".