Fujitsu FR81 Computer Hardware User Manual


 
FR81 Family
28 FUJITSU MICROELECTRONICS LIMITED CM71-00105-1E
CHAPTER 3 PROGRAMMING MODEL
3.3
Figure 3.3-13 Example of System Stack Pointer (SSP) Operation
3.3.10 User Stack Pointer (USP)
User stack pointer (USP) is a 32-bit register used to save/retrieve data to/from the user stack. The user stack
pointer (USP) is available irrespective of the CPU: whether it is in privilege mode (UM=0) or in user mode
(UM=1). In privilege mode, the stack pointer should be selected by rewriting the stack flag (S). In user
mode, only the user stack pointer (USP) is available.
Figure 3.3-14 shows the bit configuration of user stack pointer (USP).
Figure 3.3-14 User Stack Pointer (USP) Bit Configuration
When the stack flag (S) in the condition code register (CCR) is "1", the general-purpose register R15 is
used as the user stack pointer (USP). In a normal instruction, user stack pointer (USP) is used as the
general-purpose register R15.
User stack uses pre-decrement/post-decrement to save/retrieve data. While saving data, after performing a
data size decrement on the value of user stack pointer (USP), it is written onto the address indicated by the
user stack pointer (USP). While retrieving data, the data is read from the address indicated by the user stack
pointer (USP), and a data size increment is performed on the value of user stack pointer (USP).
Figure 3.3-15 shows an example of user stack pointer (USP) operation while executing the instruction "ST
R13,@-R15" when the stack flag (S) is set to "1".
Memory space
????????
????????
Before execution of ST R13,@-R15
12345678
H
76543210H
SSP
USP
17263540
H
0
R13
CCR
FFFFFFFF
H
After execution of ST R13,@-R15
12345674
H
76543210H
SSP
USP
17263540
H
17263540H
0
R13
CCR
SS
00000000
H
Memory space
????????
FFFFFFFF
H
00000000H
bit31
bit0
Initial value
XXXXXXXX
H