Make your own free website on Tripod.com

SET b,s

Set bit b of operand s.
Function: sb <- 1
 
Format: s: may be r, (HL), (IX + d), (IY + d)
 
r  
 
1100 1011
 
byte 1: CB
 
11bb brrr
 
byte 2
 
(HL)  
 
1100 1011
 
byte 1: CB
 
11bb b110
 
byte 2
 
(IX + d)  
 
1101 1101
 
byte 1: DD
 
1100 1011
 
byte 2: CB
 
dddd dddd
 
byte 3: offset data
 
11bb b110
 
byte 4
 
(IY + d)  
 
1111 1101
 
byte 1: FD
 
1100 1011
 
byte 2: CB
 
dddd dddd
 
byte 3: offset data
 
11bb b110
 
byte 4
 
b may be any one of:
0
000
1
001
2
010
3
011
4
100
5
101
6
110
7
111
r may be any one of:
A
111
B
000
C
001
D
010
E
011
H
100
L
101
Description: The specified bit of the location determined by s is set. s is defined in the description of the similar BIT instructions.
 
Data Flow:
 
Timing:
s: M cycles: T states: usec
@ 2 MHz:
r
(HL)
(IX + d)
(IY + d)
2
4
6
6
8
15
23
23
4
7.5
11.5
11.5
 
Addressing Mode: r: implicit; (HL): indirect; (IX + d), (IY+d): indexed.
 
Byte Codes:
SET  b,r
r:ABCDEHL
CB +b:0C7C0C1C2C3C4C5
1CFC8C9CACBCCCD
2D7D0D1D2D3D4D5
3DFD8D9DADBDCDD
4E7E0E1E2E3E4E5
5EFE8E9EAEBECED
6F7F0F1F2F3F4F5
7FFF8F9FAFBFCFD
 
b:01234567
SET  b,(HL)
CB +C6CED6DEE6EEF6FE
SET  b,(IX + d)
DDCB +
SET b,(IY + d)
FDCB +
 
Flags:
 
(no effect)
 
Example:
SET  7,A

OBJECT CODE
Before:
 
After: