User Stack Pointer (Usp) And System Stack Pointer (Ssp) - Fujitsu MB90335 Series Hardware Manual

16-bit microcontroller
Table of Contents

Advertisement

CHAPTER 2 CPU
2.6 Registers
2.6.2
User Stack Pointer (USP) and
System Stack Pointer (SSP)
User stack pointer (USP) and system stack pointer (SSP) are 16-bit registers that
indicate the memory addresses for saving/restoring data when a push/pop instruction
or subroutine is executed.

■ User Stack Pointer (USP) and System Stack Pointer (SSP)

User stack pointer (USP) and system stack pointer (SSP) registers are used by the stack instructions.
However, the USP register is enabled when the S flag in the processor status register is "0", and the SSP
register is enabled when the S flag is "1" (see Figure 2.6-5). Since the S flag is set when an interrupt is
accepted, register values are always saved in the memory area indicated by SSP during interrupt
processing. SSP is used for stack processing in an interrupt routine, while USP is used for stack processing
other than in an interrupt routine. If you do not need to divide the stack space, use only the SSP.
During stack processing, the upper 8 bits of an address are indicated by SSB (for SSP) or USB (for USP).
USP and SSP are not initialized by a reset. Instead, they hold undefined values.
Example of PUSHW A when the S flag is "0"
Before
AL
execution
After
AL
execution
Example of PUSHW A when the S flag is "1"
AL
AL
Note:
When you specify a value to be set in the stack pointer, use an even-numbered address whenever
possible.
32
Figure 2.6-5 Stack Manipulation Instruction and Stack Pointer
USB
C6
A624
H
S flag
56
0
SSB
USB
C6
A624
H
S flag
56
0
SSB
USB
C6
A624
H
S flag
1
56
SSB
USB
C6
A624
H
S flag
56
1
SSB
FUJITSU MICROELECTRONICS LIMITED
USP
F328
C6F326
H
H
1234
SSP
H
H
USP
F326
H
H
1234
C6F326
SSP
H
H
USP
F328
561232
H
H
1234
SSP
H
H
USP
F328
561232
H
H
1232
SSP
H
H
MB90335 Series
MSB
XX
XX
H
System stack is used
because the S flag is "0".
A6
24
H
H
H
XX
XX
H
A6
24
H
H
H
System stack is used
because the S flag is "1".
CM44-10137-6E
LSB

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lxMb90v330aMb90f337Mb90337

Table of Contents