Fujitsu MB96300 series Hardware Manual page 75

F2mc-16fx 16-bit
Hide thumbs Also See for MB96300 series:
Table of Contents

Advertisement

MB96300 Super Series Hardware Manual
2.4.2
User Stack Pointer (USP) and System Stack Pointer (SSP)
USP and SSP are 16-bit registers that indicate the memory addresses for saving and
restoring data when a push/pop instruction or subroutine is executed.
■ User stack pointer (USP) and system stack pointer (SSP)
USP and SSP are 16-bit registers that indicate the memory addresses for saving and restoring data in the
event of a push/pop instruction or subroutine execution. The USP and SSP registers are used by stack
instructions.
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.4-4"Stack manipulation instruction and stack pointer"). 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 outside an interrupt routine. If the stack space is not divided, use only the SSP.
During stack processing, the high-order eight bits of an address are indicated by SSB (for SSP) or USB (for
USP).
USP and SSP are not initialized by a reset. Instead, the values are undefined.
Figure 2.4-4 Stack manipulation instruction and stack pointer
Example 1 PUSHW A when the S flag is '0'
Before execution
After execution
Example 2 PUSHW A when the S flag is '1'
Note:
Specify an even-numbered address in the stack pointer whenever possible. An odd value will cause
AL
A624 H
USB
C6 H
S flag
56 H
0
SSB
AL
A624 H
USB
C6 H
56 H
0
SSB
AL
A624 H
USB
C6 H
1
56 H
SSB
AL
A624 H
USB
C6 H
56 H
1
SSB
MSB
USP
F328 H
C6F326 H
1234 H
SSP
User stack is used because
USP
F326 H
the S flag is '0.'
1234 H
C6F326 H
SSP
USP
F328 H
561232 H
1234 H
SSP
USP
F328 H
561232 H
System stack is used because
1232 H
SSP
the S flag is "1".
CHAPTER 2 CPU
LSB
XX
XX
A6 H
24 H
XX
XX
A6 H
24 H
67

Advertisement

Table of Contents
loading

Table of Contents