Table of Contents

Advertisement

2.2.23 DAA

DAA (Decimal Adjust Add)
Operation
Rd (decimal adjust) → Rd
Assembly-Language Format
DAA Rd
Operand Size
Byte
Description
Given that the result of an addition operation performed by an ADD.B or ADDX instruction on
4-bit BCD data is contained in an 8-bit register Rd (destination register) and the carry and half-
carry flags, the DAA instruction adjusts the general register contents by adding H'00, H'06, H'60,
or H'66 according to the table below.
C Flag
Upper 4 Bits
before
before
Adjustment
Adjustment
0
0
0
0
A to F
0
9 to F
0
A to F
1
1
1
H Flag
before
Adjustment
0 to 9
0
0 to 8
0
0 to 9
1
0
0
1
1 to 2
0
1 to 2
0
1 to 3
1
Condition Code
I
UI H
— —
*
H: Undetermined (no guaranteed value).
N: Set to 1 if the adjusted result is negative;
otherwise cleared to 0.
Z: Set to 1 if the adjusted result is zero;
otherwise cleared to 0.
V: Undetermined (no guaranteed value).
C: Set to 1 if there is a carry at bit 7;
otherwise left unchanged.
Lower 4 Bits
Value Added
before
(hexadecimal)
Adjustment
0 to 9
A to F
0 to 3
0 to 9
A to F
0 to 3
0 to 9
A to F
0 to 3
75
Decimal Adjust
U
N
Z
V
C
*
C Flag
after
Adjustment
00
0
06
0
06
0
60
1
66
1
66
1
60
1
66
1
66
1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents