2.2.25 (2) DEC (W)
DEC (DECrement)
Decrement
Operation
Rd – 1
→
Rd
Rd – 2
→
Rd
Assembly-Language Format
DEC.W #1,
Rd
DEC.W #2,
Rd
Operand Size
Word
Condition Code
H: Previous value remains unchanged.
N: Set to 1 if the result is negative; otherwise
cleared to 0.
Z:
Set to 1 if the result is zero; otherwise
cleared to 0.
V: Set to 1 if an overflow occurs (the
previous value in Rd was H'8000);
otherwise cleared to 0.
C: Previous value remains unchanged.
I
UI
H
U
N
Z
V
C
—
—
—
—
↕
↕
↕
—
Description
This instruction subtracts the immediate value 1 or 2 from the contents of a 16-bit register Rd
(destination register) and stores the result in the 16-bit register Rd.
Available Registers
Rd: R0 to R7, E0 to E7
Operand Format and Number of States Required for Execution
Notes
An overflow is caused by the operations H'8000 – 1
→
H'7FFF, H'8000 – 2
→
H'7FFE, and
H'8001 – 2
→
H'7FFF.
Instruction Format
1st byte
2nd byte
3rd byte
4th byte
Register direct
DEC.W
#1, Rd
1
B
5
rd
I
2
Register direct
DEC.W
#2, Rd
1
B
D
rd
2
No. of
States
Addressing
Mode
Mnemonic
Operands
80