Instruction Set Description
175
SLAU367P – October 2012 – Revised April 2020
Copyright © 2012–2020, Texas Instruments Incorporated
CPUX
4.6.2.15 DADC
* DADC[.W]
Add carry decimally to destination
* DADC.B
Add carry decimally to destination
Syntax
DADC dst
or
DADC.W dst
DADC.B dst
Operation
dst + C
→
dst (decimally)
Emulation
DADD #0,dst
DADD.B #0,dst
Description
The carry bit (C) is added decimally to the destination.
Status Bits
N:
Set if MSB is 1
Z:
Set if dst is 0, reset otherwise
C:
Set if destination increments from 9999 to 0000, reset otherwise
Set if destination increments from 99 to 00, reset otherwise
V:
Undefined
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
The 4-digit decimal number contained in R5 is added to an 8-digit decimal number
pointed to by R8.
CLRC
; Reset carry
; next instruction's start condition is defined
DADD
R5,0(R8)
; Add LSDs + C
DADC
2(R8)
; Add carry to MSD
Example
The 2-digit decimal number contained in R5 is added to a 4-digit decimal number pointed
to by R8.
CLRC
; Reset carry
; next instruction's start condition is defined
DADD.B
R5,0(R8)
; Add LSDs + C
DADC
1(R8)
; Add carry to MSDs