Daa (Decimal Adjust Add) - Renesas H8/300 Series Programming Manual

Table of Contents

Advertisement

DAA (Decimal Adjust Add)

<Operation>
Rd (decimal adjust) → Rd
<Assembly-Language Format>
DAA Rd
<Examples>
DAA R5L
<Operand Size>
Byte
<Description>
Given that the result of an addition operation performed by the ADD.B or ADDX instruction
on 4-bit BCD data is contained in an 8-bit general register and the carry and half-carry flags,
the DAA instruction adjusts the result by adding H'00, H'06, H'60, or H'66 to the general
register according to the table below.
Valid results are not assured if this instruction is executed under conditions other than those
stated above.
C flag
0
0
0
0
0
0
1
1
1
Status before adjustment
Upper nibble
H flag
0 – 9
0 – 8
0 – 9
A – F
9 – F
A – F
0 – 2
0 – 2
0 – 3
<Condition Code>
I
— —
I: Previous value remains unchanged.
H: Unpredictable.
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: Unpredictable.
C: Set to "1" if there is a carry from bit 7;
otherwise left unchanged.
Lower nibble
0
0 – 9
0
A – F
1
0 – 3
0
0 – 9
0
A – F
1
0 – 3
0
0 – 9
0
A – F
1
0 – 3
69
H
N
Z
*
Value
Resulting
added
C flag
H'00
0
H'06
0
H'06
0
H'60
1
H'66
1
H'66
1
H'60
1
H'66
1
H'66
1
DAA
V
C
*

Advertisement

Table of Contents
loading

Table of Contents