English
Language : 

UPD784938 Datasheet, PDF (87/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 3 CPU ARCHITECTURE
(2) Operation code generation method with RA78K4
• With RA78K4, if there is an instruction with the same function as an instruction for which A or AX is directly entered in
the operand column of the instruction operation list, the operation code for which A or AX is directly entered in the operand
column is generated first.
Example The function is the same when B is used as r in a MOV A,r instruction, and when A is used as r and B is used
as r’ in a MOVr,r’ instruction, and the same description (MOV,A,B) is used in the assembler source program.
In this case, RA78K4 generates code equivalent to the MOV A, r instruction.
• If A, X, B, C, AX, or BC is written in an instruction for which r, r’, rp, and rp’ are specified in the operand column, the A,
X, B, C, AX, and BC instructions generate an operation code that specifies the following registers according to the
operand of the RA78K4 RSS pseudo-instruction.
Register
A
X
B
C
AX
BC
RSS = 0
R1
R0
R3
R2
RP0
RP1
RSS = 1
R5
R4
R7
R6
RP2
RP3
• If R0 to R7 or RP0 to RP4 is written as r, r’, rp, or rp’ in the operand column, an operation code in accordance with that
specification is output (an operation code for which A or AX is directly entered in the operand column is not output.)
• Descriptions R1, R3, R2 or R5, R7, R6 cannot be used for registers A, B, and C used in indexed addressing and based
indexed addressing.
(3) Operating precautions
Switching the RSS bit has the same effect as having two register sets. However, when writing a program, care must be
taken to ensure that the static program description and dynamic RSS bit changes at the time of program execution always
coincide.
Also, a program that sets RSS to 1 cannot be used by a program that uses the context switching function, and therefore
program usability is poor. Moreover, since different registers are used with the same name, program readability is poor and
debugging is difficult. Therefore, if it is necessary to set RSS to 1, these disadvantages must be fully taken into consideration
when writing a program.
A register not specified by the RSS bit can be accessed by writing its absolute name.
Preliminary User’s Manual U13987EJ1V0UM00
87