Stack Pointer (Usp, Ssp); Table 2-4 Stack Address Specification - Fujitsu MB90420/5 (A) Series Hardware Manual

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

Advertisement

2.7.2 Stack Pointer (USP, SSP)

There are two stack pointers: user stack pointer (USP), and system stack pointer (SSP). Both indicate the
data save destination memory address or the return destination memory address when executing the PUSH
instruction, the POP instruction, or a subroutine. The upper 8 bits of the stack address are specified using
the user stack bank register (USB) or the system stack bank register (SSB).
When the S flag of the condition code register (CCR) is 0, the USP and the USB registers are enabled.
When the S flag is 1, the SSP and the SSB registers are enabled.
n Stack selection
2
For the F
MC-16LX, two types of stacks can be used: system stack, and user stack. The stack address is
determined by the S flag of the processor status (PS: CCR), as shown in Table 2-4.
S flag
0
1
The S flag is initialized to 1 by a reset, so the system stack is used by default. Normally, the system stack is
used for a stack operation in the interrupt routine, and the user stack is used for a stack operation using
other than the interrupt routine. When there is no particular need to divide the stack space, use only the
system stack.
Note:
As the S flag is set to 1 when an interrupt is accepted, the system stack is always used at an
interrupt.

Table 2-4 Stack Address Specification

Upper 8 bits
User stack bank register (USB)
System stack bank register (SSB)
: Initial value
CPU
Stack Address
Lower 16 bits
User stack pointer (USP)
System stack pointer (SSP)
2-19

Advertisement

Table of Contents
loading

Table of Contents