RES
Bit Manipulation Group
Expansion:
RESet bit
Usage:
res {0-7},{r}
Resets a bit in a specific position of the byte.
The bit order is %76543210 (first zero indexed byte begins at least significant).
| Instruction | Description | Opcode |
|---|---|---|
| RES 0, A | Reset bit at position 0 of the byte held in registry A | CB87 |
| RES 0, B | Reset bit at position 0 of the byte held in registry B | CB80 |
| RES 0, C | Reset bit at position 0 of the byte held in registry C | CB81 |
| RES 0, D | Reset bit at position 0 of the byte held in registry D | CB82 |
| RES 0, E | Reset bit at position 0 of the byte held in registry E | CB83 |
| RES 0, H | Reset bit at position 0 of the byte held in registry H | CB84 |
| RES 0, L | Reset bit at position 0 of the byte held in registry L | CB85 |
| RES 0, (HL) | Reset bit at position 0 of the byte held in address HL | CB86 |
| RES 0, (IX+dis) | Reset bit at position 0 of the byte held in address IX+displacement | DDCB {??} 86 |
| RES 0, (IY+dis) | Reset bit at position 0 of the byte held in address IY+displacement | FDCB {??} 86 |
| Instruction | Description | Opcode |
|---|---|---|
| RES 1, A | Reset bit at position 1 of the byte held in registry A | CB8F |
| RES 1, B | Reset bit at position 1 of the byte held in registry B | CB88 |
| RES 1, C | Reset bit at position 1 of the byte held in registry C | CB89 |
| RES 1, D | Reset bit at position 1 of the byte held in registry D | CB8A |
| RES 1, E | Reset bit at position 1 of the byte held in registry E | CB8B |
| RES 1, H | Reset bit at position 1 of the byte held in registry H | CB8C |
| RES 1, L | Reset bit at position 1 of the byte held in registry L | CB8D |
| RES 1, (HL) | Reset bit at position 1 of the byte held in address HL | CB8E |
| RES 1, (IX+dis) | Reset bit at position 1 of the byte held in address IX+displacement | DDCB {??} 8E |
| RES 1, (IY+dis) | Reset bit at position 1 of the byte held in address IY+displacement | FDCB {??} 8E |
| Instruction | Description | Opcode |
|---|---|---|
| RES 2, A | Reset bit at position 2 of the byte held in registry A | CB97 |
| RES 2, B | Reset bit at position 2 of the byte held in registry B | CB90 |
| RES 2, C | Reset bit at position 2 of the byte held in registry C | CB91 |
| RES 2, D | Reset bit at position 2 of the byte held in registry D | CB92 |
| RES 2, E | Reset bit at position 2 of the byte held in registry E | CB93 |
| RES 2, H | Reset bit at position 2 of the byte held in registry H | CB94 |
| RES 2, L | Reset bit at position 2 of the byte held in registry L | CB95 |
| RES 2, (HL) | Reset bit at position 2 of the byte held in address HL | CB96 |
| RES 2, (IX+dis) | Reset bit at position 2 of the byte held in address IX+displacement | DDCB {??} 96 |
| RES 2, (IY+dis) | Reset bit at position 2 of the byte held in address IY+displacement | FDCB {??} 96 |
| Instruction | Description | Opcode |
|---|---|---|
| RES 3, A | Reset bit at position 3 of the byte held in registry A | CB9F |
| RES 3, B | Reset bit at position 3 of the byte held in registry B | CB98 |
| RES 3, C | Reset bit at position 3 of the byte held in registry C | CB99 |
| RES 3, D | Reset bit at position 3 of the byte held in registry D | CB9A |
| RES 3, E | Reset bit at position 3 of the byte held in registry E | CB9B |
| RES 3, H | Reset bit at position 3 of the byte held in registry H | CB9C |
| RES 3, L | Reset bit at position 3 of the byte held in registry L | CB9D |
| RES 3, (HL) | Reset bit at position 3 of the byte held in address HL | CB9E |
| RES 3, (IX+dis) | Reset bit at position 3 of the byte held in address IX+displacement | DDCB {??} 9E |
| RES 3, (IY+dis) | Reset bit at position 3 of the byte held in address IY+displacement | FDCB {??} 9E |
| Instruction | Description | Opcode |
|---|---|---|
| RES 4, A | Reset bit at position 4 of the byte held in registry A | CBA7 |
| RES 4, B | Reset bit at position 4 of the byte held in registry B | CBA0 |
| RES 4, C | Reset bit at position 4 of the byte held in registry C | CBA1 |
| RES 4, D | Reset bit at position 4 of the byte held in registry D | CBA2 |
| RES 4, E | Reset bit at position 4 of the byte held in registry E | CBA3 |
| RES 4, H | Reset bit at position 4 of the byte held in registry H | CBA4 |
| RES 4, L | Reset bit at position 4 of the byte held in registry L | CBA5 |
| RES 4, (HL) | Reset bit at position 4 of the byte held in address HL | CBA6 |
| RES 4, (IX+dis) | Reset bit at position 4 of the byte held in address IX+displacement | DDCB {??} A6 |
| RES 4, (IY+dis) | Reset bit at position 4 of the byte held in address IY+displacement | FDCB {??} A6 |
| Instruction | Description | Opcode |
|---|---|---|
| RES 5, A | Reset bit at position 5 of the byte held in registry A | CBAF |
| RES 5, B | Reset bit at position 5 of the byte held in registry B | CBA8 |
| RES 5, C | Reset bit at position 5 of the byte held in registry C | CBA9 |
| RES 5, D | Reset bit at position 5 of the byte held in registry D | CBAA |
| RES 5, E | Reset bit at position 5 of the byte held in registry E | CBAB |
| RES 5, H | Reset bit at position 5 of the byte held in registry H | CBAC |
| RES 5, L | Reset bit at position 5 of the byte held in registry L | CBAD |
| RES 5, (HL) | Reset bit at position 5 of the byte held in address HL | CBAE |
| RES 5, (IX+dis) | Reset bit at position 5 of the byte held in address IX+displacement | DDCB {??} AE |
| RES 5, (IY+dis) | Reset bit at position 5 of the byte held in address IY+displacement | FDCB {??} AE |
| Instruction | Description | Opcode |
|---|---|---|
| RES 6, A | Reset bit at position 6 of the byte held in registry A | CBB7 |
| RES 6, B | Reset bit at position 6 of the byte held in registry B | CBB0 |
| RES 6, C | Reset bit at position 6 of the byte held in registry C | CBB1 |
| RES 6, D | Reset bit at position 6 of the byte held in registry D | CBB2 |
| RES 6, E | Reset bit at position 6 of the byte held in registry E | CBB3 |
| RES 6, H | Reset bit at position 6 of the byte held in registry H | CBB4 |
| RES 6, L | Reset bit at position 6 of the byte held in registry L | CBB5 |
| RES 6, (HL) | Reset bit at position 6 of the byte held in address HL | CBB6 |
| RES 6, (IX+dis) | Reset bit at position 6 of the byte held in address IX+displacement | DDCB {??} B6 |
| RES 6, (IY+dis) | Reset bit at position 6 of the byte held in address IY+displacement | FDCB {??} B6 |
| Instruction | Description | Opcode |
|---|---|---|
| RES 7, A | Reset bit at position 7 of the byte held in registry A | CBBF |
| RES 7, B | Reset bit at position 7 of the byte held in registry B | CBB8 |
| RES 7, C | Reset bit at position 7 of the byte held in registry C | CBB9 |
| RES 7, D | Reset bit at position 7 of the byte held in registry D | CBBA |
| RES 7, E | Reset bit at position 7 of the byte held in registry E | CBBB |
| RES 7, H | Reset bit at position 7 of the byte held in registry H | CBBC |
| RES 7, L | Reset bit at position 7 of the byte held in registry L | CBBD |
| RES 7, (HL) | Reset bit at position 7 of the byte held in address HL | CBBE |
| RES 7, (IX+dis) | Reset bit at position 7 of the byte held in address IX+displacement | DDCB {??} BE |
| RES 7, (IY+dis) | Reset bit at position 7 of the byte held in address IY+displacement | FDCB {??} BE |
Example
ld a, %10101010 ; load the binary value into reg A
res 3, a ; res bit 3 of register a
; value will now be %10100010