Stack Pointers (Usp, Ssp) - Fujitsu MB90460 Series Hardware Manual

F2mc-16lx 16-bit microcontroller
Table of Contents

Advertisement

3.7.2

Stack Pointers (USP, SSP)

There are two types of stack pointers: a user stack pointer (USP) and a system stack
pointer (SSP). Each stack pointer is a register that indicates the memory address of the
location of the destination for saved data or a return address when PUSH instructions,
POP instructions and subroutines are executed. The upper 8 bits of the stack address
are specified by the user stack bank register (USB) or system stack bank register (SSB).
When the S flag of the condition code register (CCR) is "0", the USP and USB registers
are valid. When the S flag is "1", the SSP and SSB registers are valid.
■ Stack Selection
2
The F
MC-16LX uses two types of stack: a system stack and a user stack.
The stack address is determined, as shown in Table 3.7-2, by the S flag in the processor status (PS: CCR).
Table 3.7-2 Stack Address Specification
S flag
0
1
Because the S flag is initialized to "1" by a reset, the system stack is used as the default.
Ordinarily, the system stack is used for interrupt routine stack operations, and the user stack is used for all
other types of stack operation. When separation of the stack space is not particularly necessary, only the
system stack should be used.
Note:
Since the S flag is set to "1" when an interrupt is accepted, the system stack is always used for
interrupts.
Figure 3.7-7 shows an example of stack operation with the system
Upper 8 bits
User stack bank register (USB)
System stack bank register (SSB)
: Initial value
Stack address
User stack pointer (USP)
System stack pointer (SSP)
stack.
CHAPTER 3 CPU
Lower 16 bits
45

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mb90465 series

Table of Contents