
74
CHAPTER 3
CPU ARCHITECTURE
User’s Manual U12697EJ4V1UD
When RSS = 1
RSS 1
; RSS quasi directive
SET1 PSWL. 5
MOV B, A
; This description corresponds to “MOV R7, R5”.
(2) Generation of instruction code in the RA78K4
In the RA78K4, when an instruction with the same function as an instruction that directly specifies A or AX
in the operand column in the operation list of the instruction is used, the instruction code that directly describes
A or AX in the operand column is given priority and generated.
Example The MOV A,r instruction where r is B has the same function as the MOV r, r’ instruction where r
is A and r’ is B. In addition, they have the same (MOV A,B) description in the assembler source
program. In this case, the RA78K4 generates code that corresponds to the MOV A, r instruction.
If A, X, B, C, AX, or BC is described in an instruction that specifies r, r’, rp, or rp’ in the operand column, the
A, X, B, C, AX, or BC instruction code generates the instruction code that specifies the following registers based
on the operand of the RSS quasi directive in the RA78K4.
Register
RSS = 0
RSS = 1
AR1
R5
XR0
R4
BR3
R7
CR2
R6
AX
RP0
RP2
BC
RP1
RP3
If R0 to R7 and RP0 to RP4 are specified for r, r’, rp, and rp’ in the operand column, an instruction code that
conforms to the specification is output. (Instruction code that directly describes A or AX in the operand column
is not output.)
The A, B, and C registers that are used in indexed addressing and based indexed addressing cannot be
described as R1, R3, R2, or R5, R7, R6.
(3) Cautions on use
Switching the RSS bit obtains the same effect as holding two register sets. However, be careful and write the
program so that implicit descriptions in the program and dynamically changing the RSS bit during program
execution always agree.
Also, since a program with RSS = 1 cannot be used in a program that uses context switching, the portability of
the program becomes poor. Furthermore, since different registers having the same name are used, the readability
of the program worsens, and debugging becomes difficult. Therefore, when RSS = 1 must be used, write the
program while taking these problems into consideration.
A register that does not have the RSS bit set can be accessed by specifying the absolute name.