78
2.2.24 DAS (decimal adjust subtract)
Operation
Rd (decimal adjust)
→
Rd
Assembly-Language Format
DAS Rd
Operand Size
Byte
Condition Code
I
H
N
Z
V
C
—
—
*
—
∆
∆
*
—
I:
Previous value remains unchanged.
H:
Unpredictable.
N:
Set to 1 when the adjusted result is negative; otherwise cleared to 0.
Z:
Set to 1 when the adjusted result is zero; otherwise cleared to 0.
V:
Unpredictable.
C:
Previous value remains unchanged.
Description
When the result of a subtraction operation performed by the SUB.B, SUBX, or NEG 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'FA, H'A0, or H'9A 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.
Status before adjustment
C flag Upper nibble
H flag
Lower nibble
Value added
Resulting C flag
0
0 - 9
0
0 - 9
H'00
0
0
0 - 8
1
6 - F
H'FA
0
1
7 - F
0
0 - 9
H'A0
1
1
6 - F
1
6 - F
H'9A
1
Instruction Formats and Number of Execution States
Instruction code
Addressing
mode
Mnem.
Operands
1st byte
2nd byte
3rd byte
4th byte
No. of
states
Register direct DAS
Rd
1
F
0
rd
2
Summary of Contents for H8/300L Series
Page 1: ...H8 300L Series Programming Manual ...
Page 6: ...iv ...
Page 8: ...2 ...
Page 11: ......
Page 14: ......
Page 46: ......
Page 48: ......
Page 60: ......
Page 83: ......
Page 116: ......
Page 150: ...144 ...
Page 151: ......
Page 156: ...150 ...