Fujitsu FR81 Computer Hardware User Manual


 
FR81 Family
18 FUJITSU MICROELECTRONICS LIMITED CM71-00105-1E
CHAPTER 3 PROGRAMMING MODEL
3.2
3.2.2 Special Usage of General-purpose Registers
General-purpose registers R13 to R15, besides being used as other general-purpose registers, are used in the
following way in some instructions.
R13 (Virtual Accumulator: AC)
Base address register for load/store to memory instructions
[Example: LD @(R13,Rj), Ri]
Accumulator for direct address designation
[Example: DMOV @dir10, R13]
Memory pointer for direct address designation
[Example: DMOV @dir10,@R13+]
R14 (Frame Pointer: FP)
Index register for load/store to memory instructions
[Example: LD @(R14,disp10), Ri]
Frame pointer for reserve/release of dynamic memory area
[Example: ENTER #u10]
R15 (Stack Pointer: SP)
Index register for load/store to memory instructions
[Example: LD @(R15,udisp6), Ri]
Stack pointer
[Example: LD @R15+,Ri]
Stack pointer for reserve/release of dynamic memory area
[Example: ENTER #u10]
3.2.3 Relation between Stack Pointer and R15
R15 functions as an indirect register. Physically it becomes either the system stack pointer (SSP) or user
pointer (USP) for dedicated registers. When the notation R15 is used in an instruction, this register will
function as USP if the stack flag (S) is "1" and as SSP if the stack flag is "0". Table 3.2-1 shows the
correlation between general-purpose register R15 and stack pointer.
When something is written on R15 as a general-purpose register, it is automatically written onto the system
stack pointer (SSP) or user stack pointer (USP) according to the value of stack flag (S).
Table 3.2-1 Correlation between General-purpose Register "R15" and Stack Pointer
Stack flag (S) is present in the condition code register (CCR) section of the program status (PS).
General-purpose register S Flag Stack pointer
R15
1 User stack pointer (USP)
0 System stack pointer (SSP)