INC increments either an 8-bit register or an 16-bit register pair.
This the multi-page printable view of this section.Click here to print.
INC increments either an 8-bit register or an 16-bit register pair.
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
\(s \longleftarrow r + 1\) | ||||||||
INC r | ||||||||
0 | 0 | r | 1 | 0 | 0 | |||
\((HL) \longleftarrow (HL) + 1\) | ||||||||
INC (HL) | ||||||||
0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 34 |
\((IX+d) \longleftarrow (IX+d) + 1\) | ||||||||
INC (IX+d) | ||||||||
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 34 |
d | ||||||||
\((IY+d) \longleftarrow (IY+d) + 1\) | ||||||||
INC (IY+d) | ||||||||
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | FD |
0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 34 |
d |
Register | r |
---|---|
B | 000 |
C | 001 |
D | 010 |
E | 011 |
H | 100 |
L | 101 |
A | 111 |
Flags |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
s | set if result negative | ||||||||
z | set if result is 0 | ||||||||
h | set if carry from bit 3 | ||||||||
p/v | set if register was 0x7F before operation, reset otherwise |
A | B | C | D | E | H | L | (HL) | (IX+d) | (IY+d) | |
---|---|---|---|---|---|---|---|---|---|---|
Op |
INC A
3C14 |
INC B
0414 |
INC C
0C14 |
INC D
1414 |
INC E
1C14 |
INC H
2414 |
INC L
2C14 |
INC (HL)
34111 |
INC (IX+d)
DD34nn323 |
INC (IY+d)
FD34nn323 |
Instruction
Opcode hexSize bytesCycle count
| Register | Memory |
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
---|---|---|---|---|---|---|---|---|
\(dd \longleftarrow dd + 1\) | ||||||||
INC qq | ||||||||
0 | 0 | dd | 0 | 0 | 1 | 1 | ||
\(IX \longleftarrow IX + 1\) | ||||||||
INC IX | ||||||||
1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | DD |
0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 23 |
\(IY \longleftarrow IY + 1\) | ||||||||
INC IY | ||||||||
1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | FD |
0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 23 |
Value | dd |
---|---|
00 | BC |
01 | DE |
10 | HL |
11 | SP |
None. |
BC | DE | HL | SP | IX | IY | |
---|---|---|---|---|---|---|
Op |
INC BC
0316 |
INC DE
1316 |
INC HL
2316 |
INC SP
3316 |
INC IX
DD23210 |
INC IY
FD23210 |
Instruction
Opcode hexSize bytesCycle count
| Register |