Figure 3.4.6 Stack Area For Interrupt Processing - Fujitsu F2MC-8L MB89620 Series Hardware Manual

8-bit microcontroller
Table of Contents

Advertisement

3.4 Interrupts
3.4.6 Stack Area for Interrupt Processing
Interrupt processing execution uses the stack area in RAM. The contents of the stack
pointer (SP) specifies the top address of the stack area.
n Stack Area for Interrupt Processing
The subroutine call instruction (CALL) and vector call instruction (CALLV) use the stack area to
save and restore the program counter (PC). The stack area is also used by the PUSHW and
POPW instructions to temporarily save and restore registers.
The stack area is located in RAM along with the data area.
Initializing the stack pointer (SP) to the top address of RAM and allocating data areas
upwards from the bottom RAM address is recommended.
Figure 3.4.6 shows the example of stack area setting.
Note: The stack area is used in the downward direction starting from a high address by functions such as
interrupts, subroutine calls, and the PUSHW instruction. Instructions such as return instructions
(RETI, RET) and the POPW instruction release stack area in the upward direction. Take care when
the stack address is decreased by multiple interrupts or subroutine calls that the stack does not
overlap the general-purpose register area or areas containing other data.
MB89620 series
0000
0080
Data area
0100
0200
Stack area
0280
FFFF

Figure 3.4.6 Stack Area for Interrupt Processing

H
I/O
H
RAM
H
General-
purpose
registers
H
Recommended set value for SP
H
(When the top address of RAM is 0280
External area
ROM
H
CHAPTER 3 CPU
)
H.
51

Advertisement

Table of Contents
loading

Table of Contents