English
Language : 

S3C880A Datasheet, PDF (175/366 Pages) Samsung semiconductor – 8-BIT CMOS 8-BIT 8-BIT MICROCONTROLLERS
S3C880A/F880A
SAM8 INSTRUCTION SET
DA – Decimal Adjust
DA
Operation:
dst
dst ← DA dst
The destination operand is adjusted to form two 4-bit BCD digits after an addition or subtraction
operation. For addition (ADD, ADC) or subtraction (SUB, SBC), the following table indicates the
operation performed. (The operation is undefined if the destination operand was not the result of a
valid addition or subtraction of BCD digits):
Instruction
ADD
ADC
SUB
SBC
Carry
Before DA
0
0
0
0
0
0
1
1
1
0
0
1
1
Bits 4–7
Value (Hex)
0–9
0–8
0–9
A–F
9–F
A–F
0–2
0–2
0–3
0–9
0–8
7–F
6–F
H Flag
Before DA
0
0
1
0
0
1
0
0
1
0
1
0
1
Bits 0–3
Value (Hex)
0–9
A–F
0–3
0–9
A–F
0–3
0–9
A–F
0–3
0–9
6–F
0–9
6–F
Number Added
to Byte
00
06
06
60
66
66
60
66
66
00 = – 00
FA = – 06
A0 = – 60
9A = – 66
Carry
After DA
0
0
0
1
1
1
1
1
1
0
0
1
1
Flags:
Format:
C: Set if there was a carry from the most significant bit; cleared otherwise (see table).
Z: Set if the result is "0"; cleared otherwise.
S: Set if the result bit 7 is set; cleared otherwise.
V: Undefined.
D: Unaffected.
H: Unaffected.
opc
dst
Bytes
2
Cycles
6
Opcode
(Hex)
40
41
Addr Mode
dst
R
IR
6-33