BIT, SET, RESET, AND TEST GROUP
The instructions in this group set, reset, or test one of the eight
bits in a CPU register (A, B, C, D, E, H, or L) or memory operand.
Register, register indirect, or indexed addressing may be used (see
Table 5-8). In all three types, the B field specifies which bit of the
byte is to be operated on as follows:
BIT
B
0
000
1
001
2
010
3
O11
4
100
5
101
6
110
7
111
BIT B,R tests the bit and sets the Z flag if the bit is a zero and
resets the Z flag if the bit is a 1. SET sets the indicated bit and does
SET 7, D
0 1 0 1
1 1
1 1
D BEFORE INSTRUCTION
1
1 0
1
1 1
1 1
D AFTER INSTRUCTION
RES S,IHLI
MEMORY
OPERAND
BIT 0, I IX + DI
BIT 0. (IX +D)
INSTRUCT ION
MEMORY
OPERAND
1 1 0 1 1 1 0 1
1 1 0 0 1 0 1 1
D
0 110 0 0 1 1 0
B IT 0 SPECIFIED
Fig. 5-19. SET, RES, BIT instruction examples.
84
Need help?
Do you have a question about the Z80 and is the answer not in the manual?
Questions and answers