Description Of Instructions; 8-Bit Transfer And Input/Output Instructions - Nintendo GAME BOY Programming Manual

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Flag Register:
F
Consists of 4 flags that are set and reset according to the results of instruction execution.
Flags CY and Z are tested by various conditional branch instructions.
Z: Set to 1 when the result of an operation is 0; otherwise reset.
N: Set to 1 following execution of the substruction instruction, regardless of the result.
H: Set to 1 when an operation results in carrying from or borrowing to bit 3.
CY: Set to 1 when an operation results in carrying from or borrowing to bit 7.

2. DESCRIPTION OF INSTRUCTIONS

2.1 8-Bit Transfer and Input/Output Instructions

LD
r, r'
Loads the contents of register r' into register r.
Codes for registers
r and r'
LD A, B ; A ← B
Examples:
LD B, D ; B ← D
r ← r'
Register
A
B
C
D
E
H
L
95
Chapter 4: CPU Instruction Set
CY
H
N
Z
CYCL
--
--
--
--
1
r, r'
111
000
001
101
011
100
101
7 6
5 4 3
2 1 0
0 1
r
r'

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents