跳转到主内容
Knowledgebase
Home
Renesas Electronics China - Knowledgebase

What is a register mode?

Latest Updated:09/04/2015

Question:

What is a register mode?

Answer:

The register modes control the number of registers of the RH850 used by CC-RH to be 32 (32-register mode) or 22 (22-register mode or common register mode). The difference between the 22-register and common register modes is described in the answer to the next question.

Register mode Working registers Registers for register variables

22

r10 ~ r14 r25 ~ r29

32

r10 ~ r19 r20 ~ r29

Common

r10 ~ r14 r25 ~ r29

That is, r15 to r24 are not used in 22-register mode.
The following are the comparative advantages and disadvantages of the situations where the 22- and 32-register modes are designated.

Advantage:
In saving and restoring at the time of an interrupt, processing to save and restore the values of registers in use by the compiler within the interrupt function (handler) proceeds.

Since the compiler uses the number of registers designated by the register mode, fewer registers have to be saved and restored in the 22-register mode, so saving and restoring will be faster.
This mode also leaves r15 to r24 freely available for use within assembler code.

Disadvantage:

The speed of normal processing might be slower, since the compiler is able to use fewer registers. This may increase the required ROM capacity.

Suitable Products
C Compiler Package for RH850 Family