Bit manipulation, Table 13, Bit manipulation group – Zilog Z08470 User Manual
Page 65
UM008007-0715
Bit Manipulation
Z80 CPU
User Manual
53
Bit Manipulation
The ability to set, reset, and test individual bits in a register or memory location is required
in almost every program. These bits can be flags in a general-purpose software routine,
indications of external control conditions, or data packed into memory locations, making
memory utilization more efficient.
With a single instruction, the Z80 CPU can set, reset, or test any bit in the Accumulator, in
any general-purpose register, or in any memory location. Table 13 lists the 240 instruc-
tions that are available for this purpose.
Table 13. Bit Manipulation Group
Register Addressing
Register
Indirect
Indexed
A
8
C
D
E
H
L
(HL)
(IX+d)
(IY+d)
Bit
DD
FD
Test Bit
0
C8
C8
C8
C8
C8
C8
C8
C8
C8
C8
47
40
41
42
43
44
45
46
d
d
1
46
46
DD
FD
C8
C8
C8
C8
C8
C8
C8
C8
C8
C8
4F
48
49
4A
48
4C
4D
4E
d
d
4E
4E
2
DD
FD
C8
C8
C8
C8
C8
C8
C8
C8
C8
C8
57
50
51
52
53
54
55
56
d
d
56
56
3
DD
FD
C8
C8
C8
C8
C8
C8
C8
C8
C8
C8
5F
58
59
5A
5B
5C
5D
5E
d
d
46
46
4
DD
FD
C8
C8
C8
C8
C8
C8
C8
C8
C8
C8
67
60
61
62
63
64
65
66
d
d
66
66
5
DD
FD
C8
C8
C8
C8
C8
C8
C8
C8
C8
C8
6F
68
69
6A
68
6C
6D
6E
d
d
6E
6E