APPENDIX B CAUTIONS


B.1 Restriction of Compiler Option

Systems embedding the RI78V4 cannot use the following compile options.

Option

Meaning

-base_number=prefix

This option specifies the notation of the radix for numeric constants. Specifies the prefix notation (0xn...n).



B.2 Handling Register Bank

Systems embedding the RI78V4 should generally operate with register bank 0.

If it is necessary to change the register bank, do so in accordance with the specifications below. Changing the register bank is enabled for some routines, and disabled for others.

[Routines where changing the register bank is enabled]

- Task
In the task, the initial register bank number is set permanently to 0.
When switching tasks in the RI78V4, only the register bank number and one bank's worth of general registers (task-switching bank) are retired/restored.
The remaining three banks of general registers are not retired or restored, so if more than two register banks are to be used in the task process, then when changing the register banks, the general register of the register bank before the change must be retired. If it is not retired, then the register bank could be corrupted in the task that is switched to.




- Interrupt servicing not managed by an OS
When changing a register bank in an interrupt process not matched by the OS, restore the register bank number of the interrupt source when the interrupt ends.


[Routines where changing the register bank is disabled]

- Interrupt handler
Interrupt handlers inherit the register bank number of the source of the interrupt.


- Cyclic handler
Cyclic handlers inherit the register bank number of the source of the timer handler interrupt.


- Idle routine
In the idle routine, the initial register bank number is set permanently to 0.


- Initialization routine
In the initialization routine, the initial register bank number is set permanently to 0. It is overwritten by register bank 0, regardless of the register bank set before OS initialization (before the call to the __urx_start function).