Stack Operations During Interrupt Processing - Fujitsu F2MC-8FX Hardware Manual

F2mc-8fx 8-bit microcontroller
Hide thumbs Also See for F2MC-8FX:
Table of Contents

Advertisement

8.1.5

Stack Operations During Interrupt Processing

This section describes how registers 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 program counter (PC) and program
status (PS) values onto a stack.
Figure 8.1-5 shows how the stack is used at the start of interrupt processing.
Immediate before interrupt
PS
PC
E000
SP
Stack Operation upon Returning from Interrupt
When the interrupt return instruction (RETI) is executed to end interrupt processing, the program status
(PS) and then the program counter (PC) are restored from the stack, in the reverse order from which they
were saved to the stack when interrupt processing started. This restores the PS and PC values to their states
prior to starting interrupt processing.
Note:
As the accumulator (A) and temporary accumulator (T) are not saved onto the stack automatically, use the
PUSHW and POPW instructions to save and restore the A and T values.
Figure 8.1-5 Stack Operation at Start of Interrupt Processing
Memory
Address
x x
027C
H
0870
H
x x
027D
H
027E
x x
H
H
027F
x x
H
x x
0280
0280
H
H
x x
0281
H
Immediate after interrupt
SP 027C
H
H
PS
0870
H
H
H
PC
E000
H
H
H
CHAPTER 8 INTERRUPTS
Memory
Address
}
0 8
027C
H
H
H
PS
7 0
027D
H
H
}
027E
E 0
H
H
PC
027F
0 0
H
H
0280
x x
H
H
x x
0281
H
H
99

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb95170j series

Table of Contents