Return from Subroutine

76543210
 
\(PC_l \longleftarrow (SP) \\ PC_h \longleftarrow (SP+1) \\ SP \longleftarrow SP+2\)
RET
11001001
 
\(\begin{rcases} PC_l \longleftarrow (SP) \\ PC_h \longleftarrow (SP+1) \\ SP \longleftarrow SP+2 \end{rcases} \text{ if } ccc = true\)
RET ccc
11ccc000
Conditions
cccAbbrev Condition Flag
000NZ Non Zero Z
001Z Zero
010NC No Carry C
011C Carry
100 PO Parity Odd P/V
101 PE Parity Even
110 P Sign Positive S
111 M Sign Negative

Timing

The unconditional RET takes 10 (4,3,3) T-States. The conditional RET takes 17(5,3,3) T-States if the condition is true and 5 T-States if false and no return was performed.

Flags Affected
None.
Opcode Matrix
UncondCNCZNZPEPONP
RET
RET
C9110
RET C
D8111
RET NC
D0111
RET Z
C8111
RET NZ
C0111
RET PE
E8111
RET PO
E0111
RET N
F8111
RET P
F0111
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Flow