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

Return to the regular view of this page.

Decoding CB Prefix

How the CB instruction prefix works

Table of Contents

Instructions with the CB prefix consist of instructions that manipulate individual bits in a register or memory.

76543210
00000xxx RLC r
00001xxx RRC r
00010xxx RL
00011xxx RR
00100xxx SLA
00101xxx SRA
00110xxx SLL
00111xxx SRL
01xxxxxx BIT b,r
10xxxxxx RES b,r
11xxxxxx SET b,r

Operations with IX and IY registers

The operations here which operator on the (HL) register do also support use with the IX and IY registers with a relative offset. They are identical to the (HL) operation but with a DD or FD prefix.

Only instructions with the lower nibble set to 6 or E are documented. The other opcodes are undocumented.

Undocumented SLL instruction

Op codes CB30CB37 are undocumented; but they do perform a shift left operation, placing a 1 in bit 0 and setting the carry flag to the original bit 7.