ADC

ADC

Add Long With Carry (DALU)

Operation

Assembler Syntax

Dc + Dd + C → Dd

ADC Dc,Dd

ADC

Description

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.

Status and Conditions that Affect Instruction

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.

Status and Conditions Changed by Instruction

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.

Example

add d0,d1,d1 ;sets the carry bit adc d4,d5 ;add with the carry bit

Register/Memory Address

D0

L1:D1

SR

D4

L5:D5

Before

$FF 8000 0008

$0:$FF 8000 0005

$00E4 0000

$00 0000 0005

$0:$00 0000 0001

After

$0:$FF 0000 000D

$00E4 0001

$0:$00 0000 0007

SR

$00E4 00001

$00E0 0000

A-22

SC140 DSP Core Reference Manual

Page 336
Image 336
Freescale Semiconductor SC140 specifications Adc, Add Long With Carry Dalu, Dc + Dd + C → Dd, ADC Dc,Dd