RET
Return From Subroutine
7-142
Syntax
RET
Operands
None
Opcode
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
0
0
0
0
0
0
0
1
1
1
1
0
1
1
1
Execution
(TOS)
→
PC
Pop stack one level.
Status Bits
None
Description
The contents of the top stack register are copied into the program counter. The
remaining stack values are then copied up one level. RET concludes subrou-
tines and interrupt service routines to return program control to the calling or
interrupted program sequence.
Words
1
Cycles for a Single RET Instruction
ROM
DARAM
SARAM
External
4
4
4
4+3p
Note:
When this instruction reaches the execute phase of the pipeline, two additional instruc-
tion words have entered the pipeline. When the PC discontinuity is taken, these two
instruction words are discarded.
Example
RET
Before Instruction
After Instruction
PC
96h
PC
37h
Stack
37h
Stack
45h
45h
75h
75h
21h
21h
3Fh
3Fh
45h
45h
6Eh
6Eh
6Eh
6Eh
6Eh
Cycles