Fig. 6.21 Stack Area - Fujitsu MB90420/5 (A) Series Hardware Manual

F2mc-16lx family 16-bit microcontrollers
Table of Contents

Advertisement

n Stack operation at returning from interrupt handling
When the interrupt return instruction (RETI) is executed at termination of interrupt handling, the values of the
dedicated registers are returned from the system stack in the reverse order (PS, PC, PCB, DTB, ADB, DPR,
A) of before the start of interrupt handling. The dedicated registers are returned to the state just before
interrupt handling started.
n Stack area
• Securing stack area
The stack area is used for saving/restoring the program counter (PC) at execution of the subroutine call
instruction (CALL) or the vector call instruction (CALLV), or for temporary saving/restoring the registers by
the PUSHW or POPW instruction other than interrupt handling. The stack area is secured together with
the data area in RAM. Figure 6.21 shows the stack area.
Vector table
(Reset, interrupt
vector call instruction)
Stack area
Notes: 1. When setting addresses in the stack pointers (SSP, USP), in principle, set even addresses.
2. Place the system stack area, user stack area, and data area not to be overlapped one another.
• System stack and user stack
Use the system stack area for interrupt handling. When the user stack area is used at issuance of
interrupt, forcibly switch to the system stack area. Consequently, the system stack area must be set
correctly even when the system mainly uses the user stack area. If there is no particular necessity to
divide the stack space, use only the system stack area.
INTERRUPT
FFFFFF
H
FFFC00
H
ROM area
1
FF0000
*
H
~
~
2
000D00
*
H
Internal RAM area
000380
H
General-purpose
register bank area
000180
H
000100
H
0000C0
H
Internal I/O area
000000
H

Fig. 6.21 Stack Area

6-35
~
~
*1: ROM capacity depends
on the product.
*2: RAM capacity depends
on the product.

Advertisement

Table of Contents
loading

Table of Contents