
60
CHAPTER 3 CPU ARCHITECTURE
User
’
s Manual U15017EJ2V0UD
(1) Using the RSS bit
Registers used in instructions where the A, X, B, C, and AX registers are directly described in the operand
column of the operation list (refer to
20.2
)
Registers that are implicitly specified in instructions that use the A, AX, B, and C registers by implied addressing
Registers that are used in addressing in instructions that use the A, B, and C registers in indexed addressing
and based indexed addressing
The registers used in these cases are switched in the following ways by the RSS bit.
When RSS = 0
A
→
R1, X
→
R0, B
→
R3, C
→
R2, AX
→
RP0, BC
→
RP1
When RSS = 1
A
→
R5, X
→
R4, B
→
R7, C
→
R6, AX
→
RP2, BC
→
RP3
The registers used in other cases always become the same registers regardless of the contents of the RSS bit.
For registers A, X, B, C, AX, and BC in NEC assembler RA78K4, instruction code is generated for any register
described by name or for registers set by an RSS pseudo instruction in the assembler.
When the RSS bit is set or reset, always specify an RSS pseudo instruction immediately before (or immediately
after) that instruction (refer to the following examples).
<Program examples>
When RSS = 0
RSS 0
; RSS pseudo instruction
CLR1 PSWL. 5
MOV B, A
; This description corresponds to
“
MOV R3, R1
”
.
When RSS = 1
RSS 1
; RSS pseudo instruction
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, RA78K4 generates code that corresponds to the MOV A, r instruction.