Stack Area For Interrupt Processing; Figure 3.4-6 Stack Area For Interrupt Processing - Fujitsu F2MC-8L Series Hardware Manual

8-bit microcontroller
Hide thumbs Also See for F2MC-8L Series:
Table of Contents

Advertisement

CHAPTER 3 CPU
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.
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.
Tip:
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.
52

Figure 3.4-6 Stack Area for Interrupt Processing

0000
0080
Data area
0100
0200
Stack area
0280
FFFF
H
I/O
H
RAM
H
General-
purpose
registers
H
Recommended set value for SP
H
(When the top address of RAM is 0280
Access
prohibited
ROM
H
)
H.

Advertisement

Table of Contents
loading

Table of Contents