ADDNC.W

ADDNC.W

Add Without Changing ADDNC.W

 

the Carry Bit (DALU)

Operation

Assembler Syntax

#s16 + Da → Dn

ADDNC.W #s16,Da,Dn {–215s16 < 215}

Description

ADDNC.W #s16,Da,Dn

Sign-extends the 16-bit immediate value to 40 bits and adds it to the source data register Da. The sum is stored in destination register Dn. The carry bit is not affected by this instruction.

Status and Conditions that Affect Instruction

Register Address

Bit Name

Description

SR[2]

SM

If set, selects 32-bit arithmetic saturation mode.

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[3]

DOVF

Set if the result cannot be represented in 40 bits, or if the result

 

 

saturates to 32 bits in arithmetic saturation mode.

Ln

L

If not in arithmetic saturation mode (SR [SM] = 0), calculates and

 

 

updates the Ln bit in the destination register. If in arithmetic saturation

 

 

mode (SR [SM] = 1), clears the Ln bit in the destination register.

Example

addnc.w #$ca3e,d1,d2

Register/Memory Address

immediate operand

D1

L2:D2

Before

$FF FFFF CA3E

$FF FFFF CA3E

After

$0:$FF FFFF 947C

SR

$00E0 0000

EMR

$00E0 0000

$0000 0000

An add with a carry allowed would result in setting the carry bit as a result of an overflow from bit 39.

A-36

SC140 DSP Core Reference Manual

Page 350
Image 350
Freescale Semiconductor SC140 specifications Addnc.W, Add Without Changing ADDNC.W, Carry Bit Dalu, Addnc.w #$ca3e,d1,d2