Add long with carry (dalu), Operation assembler syntax – Freescale Semiconductor StarCore SC140 User Manual
Page 336

A-22
SC140 DSP Core Reference Manual
ADC
ADC
Add Long With Carry (DALU)
ADC
Description
Status and Conditions that Affect Instruction
Status and Conditions Changed by Instruction
Example
add d0,d1,d1 ;sets the carry bit
adc d4,d5 ;add with the carry bit
Operation
Assembler Syntax
Dc + Dd + C
→ Dd
ADC Dc,Dd
ADC Dc,Dd
Adds two source data registers (Dc, Dd) plus the carry bit and stores the result in the second data register
(Dd). This instruction can be used in multiple precision addition as illustrated in the example, which is a
64-bit addition.
Note:
The carry bit is set correctly for multiple precision arithmetic using long word operands if the
extension of the destination data register is the sign-extension of bit 31.
Register Address
Bit Name
Description
SR[0]
C
Added as a carry bit to the LSB.
SR[5:4]
S[1:0]
The scaling mode bits determine which bits in the result are used in
the Ln bit calculation.
Register Address
Bit Name
Description
EMR[2]
DOVF
Set if the result cannot be represented in 40 bits.
Ln
L
Calculates and updates the Ln bit in the destination register.
SR[0]
C
Calculates and updates the C bit in the status register.
Register/Memory Address
Before
After
D0
$FF 8000 0008
L1:D1
$0:$FF 8000 0005
$0:$FF 0000 000D
SR
$00E4 0000
$00E4 0001
D4
$00 0000 0005
L5:D5
$0:$00 0000 0001
$0:$00 0000 0007
SR
$00E4 00001
$00E0 0000