DEC m

Decrement operand m.
Function: m <- m - 1
 
Format: m: may be r, (HL), (IX + d), (IY + d)
 
r  
 
00rrr101
 
(HL)  
 
0011 0101
 
35
 
(IX + d)  
 
1101 1101
 
byte 1: DD
 
0011 0101
 
byte 2: 35
 
dddd dddd
 
byte 3: offset data
 
(IY + d)  
 
1111 1101
 
byte 1: FD
 
0011 0101
 
byte 2: 35
 
dddd dddd
 
byte 3: offset data
 
r may be any one of:
A
111
B
000
C
001
D
010
E
011
H
100
L
101
Description: The contents of the location addressed by the specified operand are decremented and stored back at that location. m is defined in the description of the similar INC instructions.
 
Data Flow:
 
Timing:
m: M cycles: T states: usec
@ 2 MHz:
r
(HL)
(IX + d)
(IY + d)
1
3
6
6
4
11
23
23
2
5.5
11.5
11.5
 
Addressing Mode: r: implicit; (HL): indirect; (IX + d), (IY+d): indexed.
 
Byte Codes:
DEC  r
r:ABCDEHL
3D050D151D252D
 
Flags:
 
Example:
DEC  C

OBJECT CODE
Before:
 
After: