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

Return to the regular view of this page.

INC Increment

Increment by 1

Table of Contents

INC increments either an 8-bit register or an 16-bit register pair.

1 - INC 8-bit Increment

Increment 8-bit register by 1
76543210
 
\(s \longleftarrow r + 1\)
INC r
00r100
 
\((HL) \longleftarrow (HL) + 1\)
INC (HL)
0011010034
 
\((IX+d) \longleftarrow (IX+d) + 1\)
INC (IX+d)
11011101DD
0011010034
d
 
\((IY+d) \longleftarrow (IY+d) + 1\)
INC (IY+d)
11111101FD
0011010034
d
Registers
Registerr
B000
C001
D010
E011
H100
L101
A111
Flags Affected
Flags
sz-h-p/v--
sset if result negative
zset if result is 0
hset if carry from bit 3
p/vset if register was 0x7F before operation, reset otherwise
Opcode Matrix
ABCDEHL(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
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register Memory

2 - INC 16-bit Increment

Increment 16-bit register pair by 1
76543210
 
\(dd \longleftarrow dd + 1\)
INC qq
00dd0011
 
\(IX \longleftarrow IX + 1\)
INC IX
11011101DD
0010001123
 
\(IY \longleftarrow IY + 1\)
INC IY
11111101FD
0010001123
Registers
Valuedd
00BC
01DE
10HL
11SP
Flags Affected
None.
Opcode Matrix
BCDEHLSPIXIY
Op
INC BC
0316
INC DE
1316
INC HL
2316
INC SP
3316
INC IX
DD23210
INC IY
FD23210
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register