Overall Configuration of the CPU: Stack and Stack Pointer

Occurrence of the interrupt
Occurrence of the interrupt

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.

FILO method (First-in Last-out)
FILO method (First-in Last-out)

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".

Chapter 4 Toshiba Microcontrollers, Example of Core (TLCS-870/C1)

Overall Configuration of the CPU
Overall Configuration of the CPU: CPU Core (1)
Overall Configuration of the CPU: CPU Core (2)
Overall Configuration of the CPU: Program Counter
Overall Configuration of the CPU: General-purpose Register
Overall Configuration of the CPU: PSW (Flag)
Interrupt Processing
Interrupt Processing: Interrupt Type
Interrupt Processing: Maskable Interrupt
Interrupt Processing: Non Maskable Interrupt
開啟新視窗