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

Return to the regular view of this page.

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

Undocumented SET 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 SET 0,(IY+nn) instruction sets bit 0 on a specific memory address, however the undocumented SET 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
11br
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
SET A,0,(IY+nn)
FDCBnnC7
SET A,1,(IY+nn)
FDCBnnCF
SET A,2,(IY+nn)
FDCBnnD7
SET A,3,(IY+nn)
FDCBnnDF
SET A,4,(IY+nn)
FDCBnnE7
SET A,5,(IY+nn)
FDCBnnEF
SET A,6,(IY+nn)
FDCBnnF7
SET A,7,(IY+nn)
FDCBnnFF
B
SET B,0,(IY+nn)
FDCBnnC0
SET B,1,(IY+nn)
FDCBnnC8
SET B,2,(IY+nn)
FDCBnnD0
SET B,3,(IY+nn)
FDCBnnD8
SET B,4,(IY+nn)
FDCBnnE0
SET B,5,(IY+nn)
FDCBnnE8
SET B,6,(IY+nn)
FDCBnnF0
SET B,7,(IY+nn)
FDCBnnF8
C
SET C,0,(IY+nn)
FDCBnnC1
SET C,1,(IY+nn)
FDCBnnC9
SET C,2,(IY+nn)
FDCBnnD1
SET C,3,(IY+nn)
FDCBnnD9
SET C,4,(IY+nn)
FDCBnnE1
SET C,5,(IY+nn)
FDCBnnE9
SET C,6,(IY+nn)
FDCBnnF1
SET C,7,(IY+nn)
FDCBnnF9
D
SET D,0,(IY+nn)
FDCBnnC2
SET D,1,(IY+nn)
FDCBnnCA
SET D,2,(IY+nn)
FDCBnnD2
SET D,3,(IY+nn)
FDCBnnDA
SET D,4,(IY+nn)
FDCBnnE2
SET D,5,(IY+nn)
FDCBnnEA
SET D,6,(IY+nn)
FDCBnnF2
SET D,7,(IY+nn)
FDCBnnFA
E
SET E,0,(IY+nn)
FDCBnnC3
SET E,1,(IY+nn)
FDCBnnCB
SET E,2,(IY+nn)
FDCBnnD3
SET E,3,(IY+nn)
FDCBnnDB
SET E,4,(IY+nn)
FDCBnnE3
SET E,5,(IY+nn)
FDCBnnEB
SET E,6,(IY+nn)
FDCBnnF3
SET E,7,(IY+nn)
FDCBnnFB
H
SET H,0,(IY+nn)
FDCBnnC4
SET H,1,(IY+nn)
FDCBnnCC
SET H,2,(IY+nn)
FDCBnnD4
SET H,3,(IY+nn)
FDCBnnDC
SET H,4,(IY+nn)
FDCBnnE4
SET H,5,(IY+nn)
FDCBnnEC
SET H,6,(IY+nn)
FDCBnnF4
SET H,7,(IY+nn)
FDCBnnFC
L
SET L,0,(IY+nn)
FDCBnnC5
SET L,1,(IY+nn)
FDCBnnCD
SET L,2,(IY+nn)
FDCBnnD5
SET L,3,(IY+nn)
FDCBnnDD
SET L,4,(IY+nn)
FDCBnnE5
SET L,5,(IY+nn)
FDCBnnED
SET L,6,(IY+nn)
FDCBnnF5
SET L,7,(IY+nn)
FDCBnnFD
Opcode Matrix Legend
Instruction Opcode hex
 Undocumented