Fujitsu MB89950/950A Pager User Manual


 
42
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 "Stack area for interrupt processing" shows the example of stack area setting.
Figure 3.4-6 Stack area for interrupt processing
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.
General-
purpose
registers
I/O
RAM
Access
ROM
0000
H
0080
H
0100
H
0200
H
FFFFH
Recommended set value for SP
Data area
Stack area
(When the top address of RAM is 0280
H.)
prohibited
0280H