2.2.52 RTS
RTS (ReTurn from Subroutine)
Return from Subroutine
Operation
@SP+
→
PC
Assembly-Language Format
RTS
Operand Size
—
Condition Code
H: Previous value remains unchanged.
N: Previous value remains unchanged.
Z:
Previous value remains unchanged.
V: Previous value remains unchanged.
C: Previous value remains unchanged.
I
UI
H
U
N
Z
V
C
—
—
—
—
—
—
—
—
Description
This instruction returns from a subroutine by restoring the program counter (PC) from the stack.
Program execution continues from the address restored to the program counter. The PC contents
at the time of execution of this instruction are lost.
Available Registers
—
Operand Format and Number of States Required for Execution
Notes
The stack structure and number of states required for execution differ between normal mode and
advanced mode.
In normal mode, only the lower 16 bits of the program counter are restored.
Instruction Format
No. of States
1st Byte 2nd Byte 3rd Byte 4th Byte Normal Advanced
—
RTS
5
4
7
0
8
10
Addressing
Mode
Mnemonic
Operands
PC
23
16 15
8 7
0
Normal mode
PC
23
16 15
8 7
0
Advanced mode
Undet.
Don’t care
160