DEC r

Operation

r <- r - 1

Mnemonic

DEC

Operands

r

b7b6b5b4b3b2b1b0
0 0 r 1 0 1

Description

Register r is decremented and register r identifies any of the registers A, B, C, D, E, H, or L, assembled as follows in the object code.

RegisterrHex
A111$3D
B000$05
C001$0D
D010$15
E011$1D
H100$25
L101$2D

Condition Bits Affected

Sis set if result is negative, otherwise it is reset.
Zis set if result is 0, otherwise it is reset.
His set if borrow from bit 4, otherwise it is reset.
P/Vis set if r was $80 before operation, otherwise it is reset.
Nis set.
Cis not affected.

Example

If the D register contains byte $2A, then upon the execution of

	DEC	D

the D Register contains $29.