Texas Instruments MSP430x1xx User Manual page 71

Texas instruments modules and peripherals user's guide
Table of Contents

Advertisement

* DADC[.W]
Add carry decimally to destination
* DADC.B
Add carry decimally to destination
Syntax
DADC
DADC.B
Operation
dst + C −> dst (decimally)
Emulation
DADD
DADD.B
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
V: Undefined
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
The four-digit decimal number contained in R5 is added to an eight-digit deci-
mal number pointed to by R8.
CLRC
DADD
DADC
Example
The two-digit decimal number contained in R5 is added to a four-digit decimal
number pointed to by R8.
CLRC
DADD.B
DADC
dst
or
DADC.W
dst
#0,dst
#0,dst
Set if destination increments from 99 to 00, reset otherwise
; Reset carry
; next instruction's start condition is defined
R5,0(R8)
; Add LSDs + C
2(R8)
; Add carry to MSD
; Reset carry
; next instruction's start condition is defined
R5,0(R8)
; Add LSDs + C
1(R8)
; Add carry to MSDs
src,dst
RISC 16−Bit CPU
Instruction Set
3-35

Advertisement

Table of Contents
loading

Table of Contents