DEC 8-bit Decrement

Decrement
76543210
 
\(r \longleftarrow r - 1\)
DEC r
00r101
 
\((HL) \longleftarrow (HL) - 1\)
DEC (HL)
00110101
 
\((IX+d) \longleftarrow (IX+d) - 1\)
DEC (IX+d)
11011101DD
0011010135
d
 
\((IY+d) \longleftarrow (IY+d) - 1\)
DEC (IY+d)
11111101FD
0011010135
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 borrow from bit 4
p/vset if register was 0x80 before operation, reset otherwise
Opcode Matrix
ABCDEHL(HL)(IX+d)(IY+d)
Op
DEC A
3D14
DEC B
0514
DEC C
0D14
DEC D
1514
DEC E
1D14
DEC H
2514
DEC L
2D14
DEC (HL)
35111
DEC (IX+d)
DD35nn323
DEC (IY+d)
FD35nn323
Opcode Matrix Legend
Instruction Opcode hexSize bytesCycle count
 Register Memory

Last modified November 16, 2021: Add flags to math operations (63d34c2)