Interrupt Processing Stack Area - Fujitsu F2MC-8FX Hardware Manual

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

Advertisement

CHAPTER 8 INTERRUPTS
8.1.6

Interrupt Processing Stack Area

The stack area in RAM is used for interrupt processing. The stack pointer (SP) contains
the start address of the stack area.
Interrupt Processing Stack Area
The stack area is also used to save and restore the program counter (PC) when subroutine call (CALL) or
vector call (CALLV) instructions are executed and to temporarily save and restore the registers via the
PUSHW and POPW instructions.
• The stack area is located in RAM together with the data area.
• It is advisable to initialize the stack pointer (SP) to the maximum RAM address and allocate data areas
starting from the minimum RAM address.
Figure 8.1-6 shows an example of setting the stack area.
Figure 8.1-6 Setting Example of Interrupt Processing Stack Area
Data area
Note:
The stack area is allocated in descending order of addresses for interrupts, subroutine calls, and the PUSHW
instruction; it is deallocated in ascending order of addresses for return (PETI, RET) and POPW instructions.
When the stack area address used decreases for nested interrupts or subroutines, prevent the stack area from
overlapping the data area or general-purpose register area containing other data.
100
0000
H
0080
H
0100
H
0200
H
Stack area
0280
H
FFFF
H
I / O
RAM
General-
purpose
register
Recommended SP value
(assuming a maximum RAM
address of 0280
Access
barred
ROM
)
H

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb95170j series

Table of Contents