250Chapter 7 Interrupt/Exception Processing FunctionUser’s Manual U16580EE3V1UD007.4.2 RestoreRecovery from software exception processing is carried out by the RETI instruction.By executing the RETI instruction, the CPU carries out the following processing and shifts control to therestored PC’s address.<1> Loads the restored PC and PSW from EIPC and EIPSW because the PSW.EP bit 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-20: RETI Instruction ProcessingCaution: When the PSW.EP bit and the PSW.NP bit are changed by the LDSR instructionduring the software exception process, in order to restore the PC and PSW correctlyduring recovery by the RETI instruction, it is necessary to set PSW.EP back to 0using the LDSR instruction immediately before the RETI instruction.Remark: The solid line shows the CPU processing flow.PSW.EPRETI instructionPCPSWEIPCEIPSWPSW.NPOriginal processing restoredPCPSWFEPCFEPSW1100