
75
CHAPTER 3 CPU ARCHITECTURE
3.7.3 Use of RSS bit
Basically, the RSS bit should be fixed at 0 at all times.
The following explanation refers to the case where a 78K/III series program is used, and the program used sets the RSS
bit to 1. This explanation can be skipped if the RSS bit is fixed at 0.
The RSS bit is provided to allow the functions of A (R1), X (R0), B (R3), C (R2), AX (RP0) and BC (RP1) to be used by
registers R4 to R7 (RP2, RP3) as well. Effective use of this bit enables efficient programs to be written in terms of program
size and program execution.
However, careless use can result in unforeseen problems. Therefore, the RSS bit should always be set to 0. The RSS
bit should only be set to 1 when a 78K/III series program is used.
Use of the RSS bit set to 0 in all programs will improve programming and debugging efficiency.
Even when using a program in which the RSS bit set to 1 is used, it is recommended that the program be amended if
possible so that it does not set the RSS bit to 1.
(1) RSS bit recommendations
Registers used by instructions for which the A, X, B, C and AX registers are directly entered in the operand column
of the operation list (refer to
21.2.
)
Registers specified as implied by instructions that use the A, AX, B and C registers by means of implied addressing
Registers used in addressing by instructions that use the A, B and C registers in indexed addressing and based
indexed addressing
The registers used in these cases are switched as follows according to 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
Registers used other than those mentioned above are always the same irrespective of the value of the RSS bit. With
the NEC assembler (RA78K4), the register operation code generated when the A, X, B, C, AX and BC registers are
described by those names is determined by the assembler RSS pseudo-instruction.
When the RSS bit is set or reset, an RSS pseudo-instruction must be written immediately before (or immediately
after) the relevant instruction (refer to
example
below).
<Program example>
When RSS is set to 0
RSS
CLR1 PSWL.5
MOV
B, A
0
; RSS pseudo-instruction
; This code is equivalent to “MOV R3, R1”.
When RSS is set to 1
RSS
SET1 PSWL.5
MOV
B, A
1
; RSS pseudo-instruction
; This code is equivalent to “MOV R7, R5”.