UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
101
DEC
Decrement
DEC dst
Operation
dst
←
dst - 1
Description
The contents of the destination operand are decremented by one.
Flags
Attributes
Escaped Mode Addressing
Using Escaped Mode Addressing, address modes R or IR can specify a Working Register.
If the destination address is prefixed by
EH
(1110B), a Working Register is inferred. For
example, if Working Register R12 (
CH
) is the desired destination operand, use
ECH
as the
destination operand in the opcode. To access Registers with addresses
E0H
to
EFH
, either
set the Working Group Pointer, RP[7:4], to
EH
or use indirect addressing.
Examples
•
If Working Register R10 contains
2AH
, the statement:
DEC R10
Object Code: 30 EA
leaves the value
29H
in Working Register R10 and clears the Z, V, and S flags.
•
If Register B3H contains CBH, and Register CBH contains
01H
, the statement:
C
Unaffected.
Z
Set if the result is zero; reset otherwise.
S
Set if Bit 7 of the result is set; reset otherwise.
V
Set if an arithmetic overflow occurs; reset otherwise.
D
Unaffected.
H
Unaffected.
Mnemonic
Destination
Opcode (Hex)
Operand 1
Operand 2
Operand 3
DEC
R1
30
R1
—
—
DEC
@R1
31
R1
—
—