APPENDIX B CAUTIONS
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.
- 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.
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.
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.
- Interrupt handler
Interrupt handlers inherit the register bank number of the source of the interrupt.
Interrupt handlers inherit the register bank number of the source of the interrupt.