Instruction Set
3-36
RISC 16−Bit CPU
DADD[.W]
Source and carry added decimally to destination
DADD.B
Source and carry added decimally to destination
Syntax
DADD
src,dst
or DADD.W
src,dst
DADD.B
src,dst
Operation
src + dst + C −> dst (decimally)
Description
The source operand and the destination operand are treated as four binary
coded decimals (BCD) with positive signs. The source operand and the carry
bit (C) are added decimally to the destination operand. The source operand
is not affected. The previous contents of the destination are lost. The result is
not defined for non-BCD numbers.
Status Bits
N: Set if the MSB is 1, reset otherwise
Z: Set if result is zero, reset otherwise
C: Set if the result is greater than 9999
Set if the result is greater than 99
V: Undefined
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Example
The eight-digit BCD number contained in R5 and R6 is added decimally to an
eight-digit BCD number contained in R3 and R4 (R6 and R4 contain the
MSDs).
CLRC
; clear carry
DADD
R5,R3
; add LSDs
DADD
R6,R4
; add MSDs with carry
JC
OVERFLOW ; If carry occurs go to error handling routine
Example
The two-digit decimal counter in the RAM byte CNT is incremented by one.
CLRC
; clear carry
DADD.B
#1,CNT
; increment decimal counter
or
SETC
DADD.B
#0,CNT
;
≡
DADC.B CNT
Summary of Contents for MSP430x1xx
Page 1: ... 2005 Mixed Signal Products User s Guide SLAU049E ...
Page 6: ...vi ...
Page 18: ...1 6 Introduction ...
Page 36: ...2 18 System Resets Interrupts and Operating Modes ...
Page 112: ...3 76 ...
Page 130: ...4 18 Basic Clock Module ...
Page 152: ...5 22 Flash Memory Controller ...
Page 160: ...6 8 Supply Voltage Supervisor ...
Page 168: ...7 8 Hardware Multiplier ...
Page 192: ...8 24 ...
Page 200: ...9 8 Digital I O ...
Page 234: ...11 24 Timer_A ...
Page 260: ...12 26 Timer_B ...
Page 291: ...13 31 USART Peripheral Interface UART Mode ...
Page 314: ...14 23 USART Peripheral Interface SPI Mode ...
Page 346: ...15 32 USART Peripheral Interface I2C Mode ...
Page 358: ...16 12 Comparator_A ...
Page 386: ...17 28 ADC12 ...
Page 418: ...18 32 ADC10 ...
Page 432: ...19 14 DAC12 ...