FUJITSU FR family 32-bit microcontroller instruction manuel CM71-00101-5E User Manual
Page 51
27
CHAPTER 3 REGISTER DESCRIPTIONS
3.3.5
System Stack Pointer (SSP), User Stack Pointer (USP)
The system stack pointer (SSP) and user stack pointer (USP) are registers that refer to
the stack area. The "S" flag in the "CCR" determines whether the "SSP" or "USP" is
used. Also, when an "EIT" event occurs, the program counter (PC) and program status
(PS) values are saved to the stack area designated by the "SSP", regardless of the value
of the "S" flag at that time.
■
System Stack Pointer (SSP), User Stack Pointer (USP)
The system stack pointer (SSP) and user stack pointer (USP) are pointers that refer to the stack area. The
stack area is accessed by instructions that use general-purpose register "R15" as an indirect register, as well
as register multi-transfer instructions. "R15" is used as an indirect register by the "SSP" when the "S" flag
in the condition code register (CCR) is "0" and the "USP" when the "S" flag is "1". Also, when an "EIT"
event occurs, the program counter (PC) and program status (PS) values are saved to the stack area
designated by the "SSP", regardless of the value of the "S" flag at that time.
Figure 3.3-12 shows an example of stack pointer operation in executing the instruction "ST R13, @-R15"
when the "S" flag is set to "0". Figure 3.3-13 shows an example of the same operation when the "S" flag is
set to "1".
Figure 3.3-12 Example of Stack Pointer Operation in Execution of Instruction "ST R13, @-R15"
when "S" Flag = 0
Memory space
????????
????????
Before execution of ST R13,@-R15
12345678
H
76543210
H
SSP
USP
17263540
H
0
R13
CCR
FFFFFFFF
H
After execution of ST R13,@-R15
12345674
H
76543210
H
SSP
USP
17263540
H
17263540
H
0
R13
CCR
S
S
00000000
H
Memory space
????????
FFFFFFFF
H
00000000
H