RTE (ReTurn from Exception)
<Operation>
@SP+ → CCR
@SP+ → PC
<Assembly-Language Format>
RTE
<Examples>
RTE
<Operand Size>
—
<Description>
This instruction returns from an interrupt-handling routine. It pops the condition code register
(CCR) and program counter (PC) from the stack. Program execution continues from the
address restored to the program counter.
The CCR and PC contents at the time of execution of this instruction are lost.
The CCR is one byte in size, but it is popped from the stack as a word (in which the lower 8
bits are ignored).
This instruction therefore adds 4 to the value of the stack pointer (R7).
<Instruction Formats>
Addressing
mode
Mnem.
Operands
RTE
<Condition Code>
I
I: Restored from stack.
H: Restored from stack.
N: Restored from stack.
Z: Restored from stack.
V: Restored from stack.
C: Restored from stack.
Instruction code
1st byte
2nd byte
5
6
7
0
102
H
N
Z
3rd byte
4th byte
RTE
V
C
No. of
states
10