RTE

Return from the exception

RTE

ReTurn from Exception


[Syntax]

RTE

 

[Operation]

PC = *SP;

SP = SP + 4;

tmp = *SP;

SP = SP + 4;

PSW = tmp;

LI = 0;

 

[Function]

-

This instruction returns execution from the exception handling routine by restoring the PC and PSW contents that were preserved when the exception was accepted.

-

This instruction is a privileged instruction. Attempting to execute this instruction in user mode generates a privileged instruction exception.

-

If returning is accompanied by a transition to user mode, the U bit in the PSW becomes 1.

-

This instruction sets the LI flag within the CPU to 0 if you have specified the assembler option -isa with selection of the instruction set of the RXv2 or a later version. [V2.01.00 or later]

 

[Instruction Format]

Syntax

Code Size

(Byte)

RTE

2

 

[Flag Change]

Flag

C

V

S

O

Change

*

*

*

*

Note

* The flags become the corresponding values on the stack.

 

[Description Example]

RTE