MB95630H Series
MN702-00009-2v0-E
FUJITSU SEMICONDUCTOR LIMITED
79
CHAPTER 5 INTERRUPTS
5.1 Interrupts
5.1.5
Stack Operation During Interrupt Processing
This section describes how the contents of a register are saved and restored
during interrupt processing.
■
Stack Operation at the Start of Interrupt Processing
Once the CPU accepts an interrupt, it automatically saves the current value of the program
counter (PC) and that of the program status (PS) values to the stack.
Figure 5.1-4 shows the stack operation at the start of interrupt processing.
Figure 5.1-4 Stack Operation at Start of Interrupt Processing
■
Stack Operation after Returning from Interrupt
When the CPU executes the interrupt return instruction (RETI) at the end of interrupt
processing, it restores from the stack the value of the program status (PS) first and that of the
program counter (PC), which is opposite to the sequence of saving the two values to the stack.
After the restoration, both PS and PC return to their states before the start of interrupt
processing.
Note:
Since the value of the accumulator (A) and that of the temporary accumulator (T) are not
automatically saved to the stack, use the PUSHW and POPW instructions to save and
restore the values of A and T.
Immediately before interrupt
SP
Memory
0xXX
Address
Immediately after interrupt
PC
PS
Memory
Address
}
}
PC
PS
0xXX
0xXX
0xXX
0xXX
0xXX
0x08
0x70
0xE0
0x00
0xXX
0xXX
0x0870
0xE000
0x0280
SP
PC
PS
0x027C
0x0870
0xE000
0x027C
0x0281
0x027D
0x027E
0x027F
0x0280
0x027C
0x0281
0x027D
0x027E
0x027F
0x0280
Summary of Contents for 8FX
Page 2: ......
Page 4: ......
Page 8: ...iv ...
Page 18: ...xiv ...
Page 22: ...xviii ...
Page 650: ......