![NEC V850/SC1 User Manual Download Page 247](http://html.mh-extra.com/html/nec/v850-sc1/v850-sc1_user-manual_248178247.webp)
CHAPTER 7 INTERRUPT/EXCEPTION PROCESSING FUNCTION
User’s Manual U15109EJ3V0UD
245
7.5.3 Restore
To restore or return execution from the exception trap, the RETI instruction is used.
Operation of RETI instruction
When the RETI instruction is executed, the CPU performs the following processing, and transfers control to the
address of the restored PC.
(1) Restores the restored PC and PSW from EIPC and EIPSW because the EP bit of the PSW is 1.
(2) Transfers control to the address of the restored PC and PSW.
The processing of the RETI instruction is shown below.
Figure 7-15. RETI Instruction Processing
RETI instruction
Jump to PC
PC
PSW
EIPC
EIPSW
PSW. EP
1
0
1
0
PC
PSW
FEPC
FEPSW
PSW. NP
Caution
When the PSW.EP bit and the PSW.NP bit are changed by the LDSR instruction during exception
trap processing, in order to restore the PC and PSW correctly during recovery by the RETI
instruction, it is necessary to set PSW.EP back to 1 using the LDSR instruction immediately
before the RETI instruction.
Remark
The solid line shows the CPU processing flow.