RES Reset bit in (IX+d) and copy into register r
Undocumented Reset bit in (IX+d) and copy into register r
There are a few undocumented instructions that performs an action and then copies the result into a register.
For example the official RES 0,(IX+nn)
instruction resets bit 0 on a specific memory address,
however the undocumented RES B,0,(IX+nn)
0xDDCBnn00 instruction does the same thing but then
copies the result into the B register.
\((IX+d)_b \longleftarrow 0 \\ r \longleftarrow (IX+d)\)
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | CB |
d | ||||||||
1 | 0 | b | r |
Register | r |
---|---|
B | 000 |
C | 001 |
D | 010 |
E | 011 |
H | 100 |
L | 101 |
A | 111 |
Value | b | |
---|---|---|
0 | 000 | |
1 | 001 | |
2 | 010 | |
3 | 011 | |
4 | 100 | |
5 | 101 | |
6 | 110 | |
7 | 111 |
Z is set if the specified bit in the source is 0, otherwise it is cleared.
The result is stored both in memory and the specified register.
r=%110 does exist, it is the official documented operation with no auto-copy to a register.
Opcode Matrix
BIT 0 | BIT 1 | BIT 2 | BIT 3 | BIT 4 | BIT 5 | BIT 6 | BIT 7 | |
---|---|---|---|---|---|---|---|---|
A |
RES A,0,(IX+nn)
DDCBnn87 |
RES A,1,(IX+nn)
DDCBnn8F |
RES A,2,(IX+nn)
DDCBnn97 |
RES A,3,(IX+nn)
DDCBnn9F |
RES A,4,(IX+nn)
DDCBnnA7 |
RES A,5,(IX+nn)
DDCBnnAF |
RES A,6,(IX+nn)
DDCBnnB7 |
RES A,7,(IX+nn)
DDCBnnBF |
B |
RES B,0,(IX+nn)
DDCBnn80 |
RES B,1,(IX+nn)
DDCBnn88 |
RES B,2,(IX+nn)
DDCBnn90 |
RES B,3,(IX+nn)
DDCBnn98 |
RES B,4,(IX+nn)
DDCBnnA0 |
RES B,5,(IX+nn)
DDCBnnA8 |
RES B,6,(IX+nn)
DDCBnnB0 |
RES B,7,(IX+nn)
DDCBnnB8 |
C |
RES C,0,(IX+nn)
DDCBnn81 |
RES C,1,(IX+nn)
DDCBnn89 |
RES C,2,(IX+nn)
DDCBnn91 |
RES C,3,(IX+nn)
DDCBnn99 |
RES C,4,(IX+nn)
DDCBnnA1 |
RES C,5,(IX+nn)
DDCBnnA9 |
RES C,6,(IX+nn)
DDCBnnB1 |
RES C,7,(IX+nn)
DDCBnnB9 |
D |
RES D,0,(IX+nn)
DDCBnn82 |
RES D,1,(IX+nn)
DDCBnn8A |
RES D,2,(IX+nn)
DDCBnn92 |
RES D,3,(IX+nn)
DDCBnn9A |
RES D,4,(IX+nn)
DDCBnnA2 |
RES D,5,(IX+nn)
DDCBnnAA |
RES D,6,(IX+nn)
DDCBnnB2 |
RES D,7,(IX+nn)
DDCBnnBA |
E |
RES E,0,(IX+nn)
DDCBnn83 |
RES E,1,(IX+nn)
DDCBnn8B |
RES E,2,(IX+nn)
DDCBnn93 |
RES E,3,(IX+nn)
DDCBnn9B |
RES E,4,(IX+nn)
DDCBnnA3 |
RES E,5,(IX+nn)
DDCBnnAB |
RES E,6,(IX+nn)
DDCBnnB3 |
RES E,7,(IX+nn)
DDCBnnBB |
H |
RES H,0,(IX+nn)
DDCBnn84 |
RES H,1,(IX+nn)
DDCBnn8C |
RES H,2,(IX+nn)
DDCBnn94 |
RES H,3,(IX+nn)
DDCBnn9C |
RES H,4,(IX+nn)
DDCBnnA4 |
RES H,5,(IX+nn)
DDCBnnAC |
RES H,6,(IX+nn)
DDCBnnB4 |
RES H,7,(IX+nn)
DDCBnnBC |
L |
RES L,0,(IX+nn)
DDCBnn85 |
RES L,1,(IX+nn)
DDCBnn8D |
RES L,2,(IX+nn)
DDCBnn95 |
RES L,3,(IX+nn)
DDCBnn9D |
RES L,4,(IX+nn)
DDCBnnA5 |
RES L,5,(IX+nn)
DDCBnnAD |
RES L,6,(IX+nn)
DDCBnnB5 |
RES L,7,(IX+nn)
DDCBnnBD |
Instruction
Opcode hex
| Undocumented |
Last modified November 9, 2021: Fix titles (8bbc127)