Nintendo GAME BOY Programming Manual page 120

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Game Boy Programming Manual
RET
If condition cc and the flag match, control is returned to the source program by popping from the memory
stack the PC value pushed to the stack when the subroutine was called.
Example:
Address
8000h
8003h
9000h
CP
RET
If cc true,
← (SP)
PC
L
← (SP+1)
PC
H
SP ← SP + 2
CALL
9000h
0
Z
; Returns to address 8003h if Z = 1.
CY
H
--
--
Moves to next instruction after 2 cycles if Z = 0.
120
N
Z
CYCL
7 6
--
--
5/2
11
5 4 3
2 1 0
Occ
000

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents