Table of Contents

Advertisement

2.2.52 RTS

RTS (ReTurn from Subroutine)
Operation
@SP+ → PC
Assembly-Language Format
RTS
Operand Size
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
Addressing
Mnemonic
Mode
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.
PC
Undet.
Normal mode
23
Operands
1st Byte 2nd Byte 3rd Byte 4th Byte Normal Advanced
RTS
16 15
8 7
Condition Code
I
UI H
— — — — — — — —
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.
Instruction Format
5
4
7
0
Don't care
PC
Advanced mode
0
160
Return from Subroutine
U
N
Z
No. of States
8
23
16 15
8 7
V
C
10
0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents