Nintendo GAME BOY Programming Manual page 104

Hide thumbs Also See for GAME BOY:
Table of Contents

Advertisement

Game Boy Programming Manual
Examples: When A = 3Bh, (HL) = 4Fh, H = 2Ah, and CY = 1,
SBC A, H ;
SBC A, 3Ah ; A ← 00h, Z ← 1, H ← 0, N ← 1 CY ← 0
SBC A, (HL) ; A ← EBh, Z ← 0, H ← 1, N ← 1 CY ← 1
AND
s
Takes the logical-AND for each bit of the contents of operand s and register A, and stores the results in
register A.
r, n, and (HL) are used for operand s.
Examples: When A = 5Ah, L = 3Fh and (HL) = 0h,
AND L
AND 38h ; A ← 18h, Z ← 0, H ← 1, N ← 0 CY ← 0
AND (HL)
OR
s
Takes the logical-OR for each bit of the contents of operand s and register A and stores the results in
register A. r, n, and (HL) are used for operand s.
SBC
A,
r
SBC
A,
n
SBC
A.
(HL)
A ← 10h, Z ← 0, H ← 0, N ← 1 CY ← 0
A ← A
AND
r
AND
n
AND
(HL)
A ← 1Ah, Z ← 0, H ← 1, N ← 0 CY ← 0
;
; A ← 00h, Z ← 1, H ← 1, N ← 0 CY ← 0
AVs
CYCL
7
6
5 4 3
1
10
011
2
11
011
2
10
011
CY
s
0
CYCL
7
6
5
1
10
100
2
11
100
2
10
100
CY
0
104
2 1 0
r
110
n
110
H
N
Z
CYCL
1
0
*
--
4
3
2
1
0
r
110
n
110
H
N
Z
CYCL
0
0
*
--
7 6
5 4 3
2 1 0
--
--
--
7 6
5 4 3
2 1 0
--
--
--

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents