Nintendo GAME BOY Programming Manual page 97

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

LD
A,
Loads into register A the contents of the internal RAM, port register, or mode register at the address in
the range FF00h-FFFFh specified by register C.
Example: When C = 95h,
LD A, (C) ; A ← contents of (FF95h)
LD
(C),
Loads the contents of register A in the internal RAM, port register, or mode register at the address in the
range FF00h-FFFFh specified by register C.
Example: When C = 9Fh,
LD (C), A ; (FF9Fh) ← A
LD
A,
Loads into register A the contents of the internal RAM, port register, or mode register at the address in
the range FF00h-FFFFh specified by the 8-bit immediate operand n.
Note, however, that a 16-bit address should be specified for the mnemonic portion of n, because only the
lower-order 8 bits are automatically reflected in the machine language.
Example: To load data at FF34h into register A, type the following.
LD A, (FF34)
Typing only LD A, (34) would cause the address to be incorrectly interpreted as 0034, resulting in the
instruction LD A, (0034) .
LD
(n),
Loads the contents of register A to the internal RAM, port register, or mode register at the address in the
range FF00h-FFFFh specified by the 8-bit immediate operand n.
Note, however, that a 16-bit address should be specified for the mnemonic portion of n, because only the
lower-order 8 bits are automatically reflected in the machine language.
Example: To load the contents of register A in 0xFF34, type the following.
LD (FF34), A
Typing only LD (34), A would cause the address to be incorrectly interpreted as 0034, resulting in the
instruction LD (0034), A .
A ← (FF00H+C)
(C)
(FF00H+C) ← A
A
A ← (n)
(n)
(n) ← A
A
CY
H
N
--
--
--
CY
H
N
--
--
--
CY
H
N
--
--
--
CY
H
N
--
--
--
97
Chapter 4: CPU Instruction Set
Z
CYCL
7 6
5 4 3
--
2
11
110
Z
CYCL
7 6
5 4 3
--
2
11
100
Z
CYCL
7 6
5 4 3
--
3
11
110
n
Z
CYCL
7 6
5 4 3
--
3
11
100
n
2 1 0
010
2 1 0
010
2 1 0
000
2 1 0
000

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents