This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

RES Reset bit in (IY+d) and copy into register r

Undocumented Reset bit in (IY+d) and copy into register r

Table of Contents

There are a few undocumented instructions that performs an action and then copies the result into a register.

For example the official RES 0,(IY+nn) instruction resets bit 0 on a specific memory address, however the undocumented RES B,0,(IY+nn)0xFDCBnn00 instruction does the same thing but then copies the result into the B register.

\((IY+d)_b \longleftarrow 0 \\ r \longleftarrow (IY+d)\)

76543210
11111101FD
11001011CB
d
10br
Registers
Registerr
B000
C001
D010
E011
H100
L101
A111
Bits
Valueb
0000
1001
2010
3011
4100
5101
6110
7111

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 0BIT 1BIT 2BIT 3BIT 4BIT 5BIT 6BIT 7
A
RES A,0,(IY+nn)
FDCBnn87
RES A,1,(IY+nn)
FDCBnn8F
RES A,2,(IY+nn)
FDCBnn97
RES A,3,(IY+nn)
FDCBnn9F
RES A,4,(IY+nn)
FDCBnnA7
RES A,5,(IY+nn)
FDCBnnAF
RES A,6,(IY+nn)
FDCBnnB7
RES A,7,(IY+nn)
FDCBnnBF
B
RES B,0,(IY+nn)
FDCBnn80
RES B,1,(IY+nn)
FDCBnn88
RES B,2,(IY+nn)
FDCBnn90
RES B,3,(IY+nn)
FDCBnn98
RES B,4,(IY+nn)
FDCBnnA0
RES B,5,(IY+nn)
FDCBnnA8
RES B,6,(IY+nn)
FDCBnnB0
RES B,7,(IY+nn)
FDCBnnB8
C
RES C,0,(IY+nn)
FDCBnn81
RES C,1,(IY+nn)
FDCBnn89
RES C,2,(IY+nn)
FDCBnn91
RES C,3,(IY+nn)
FDCBnn99
RES C,4,(IY+nn)
FDCBnnA1
RES C,5,(IY+nn)
FDCBnnA9
RES C,6,(IY+nn)
FDCBnnB1
RES C,7,(IY+nn)
FDCBnnB9
D
RES D,0,(IY+nn)
FDCBnn82
RES D,1,(IY+nn)
FDCBnn8A
RES D,2,(IY+nn)
FDCBnn92
RES D,3,(IY+nn)
FDCBnn9A
RES D,4,(IY+nn)
FDCBnnA2
RES D,5,(IY+nn)
FDCBnnAA
RES D,6,(IY+nn)
FDCBnnB2
RES D,7,(IY+nn)
FDCBnnBA
E
RES E,0,(IY+nn)
FDCBnn83
RES E,1,(IY+nn)
FDCBnn8B
RES E,2,(IY+nn)
FDCBnn93
RES E,3,(IY+nn)
FDCBnn9B
RES E,4,(IY+nn)
FDCBnnA3
RES E,5,(IY+nn)
FDCBnnAB
RES E,6,(IY+nn)
FDCBnnB3
RES E,7,(IY+nn)
FDCBnnBB
H
RES H,0,(IY+nn)
FDCBnn84
RES H,1,(IY+nn)
FDCBnn8C
RES H,2,(IY+nn)
FDCBnn94
RES H,3,(IY+nn)
FDCBnn9C
RES H,4,(IY+nn)
FDCBnnA4
RES H,5,(IY+nn)
FDCBnnAC
RES H,6,(IY+nn)
FDCBnnB4
RES H,7,(IY+nn)
FDCBnnBC
L
RES L,0,(IY+nn)
FDCBnn85
RES L,1,(IY+nn)
FDCBnn8D
RES L,2,(IY+nn)
FDCBnn95
RES L,3,(IY+nn)
FDCBnn9D
RES L,4,(IY+nn)
FDCBnnA5
RES L,5,(IY+nn)
FDCBnnAD
RES L,6,(IY+nn)
FDCBnnB5
RES L,7,(IY+nn)
FDCBnnBD
Opcode Matrix Legend
Instruction Opcode hex
 Undocumented