Motorola DSP56800 Manual page 262

16-bit digital signal processor
Table of Contents

Advertisement

ADD
Operation:
S + D →
D
Description: Add the source operand (S) to the destination operand (D) and store the result in the destination accu-
mulator. Words (16 bits), long words (32 bits), and accumulators (36 bits) may be added to the desti-
nation.
Usage:
This instruction can be used for both integer and fractional two's-complement data.
Example:
ADD
Before Execution
0
0100
A2
A1
X0
FFFF
Explanation of Example:
Prior to execution, the16-bit X0 register contains the value $FFFF, and the 36-bit A accumulator con-
tains the value $0:0100:0000. The ADD instruction automatically appends the 16-bit value in the X0
register with 16 LS zeros, sign extends the resulting 32-bit long word to 36 bits, and adds the result to
the 36-bit A accumulator. Thus, 16-bit operands are always added to the MSP of A or B (A1 or B1),
with the result correctly extending into the extension register (A2 or B2). Operands of 16 bits can be
added to the LSP of A or B (A0 or B0) by loading the 16-bit operand into Y0; this forms a 32-bit word
by loading Y1 with the sign extension of Y0 and executing an ADD Y,A or ADD Y,B instruction.
Similarly, the second accumulator can also be used as the source operand.
Note:
C is set correctly using word or long word source operands if the extension register of the destination
accumulator (A2 or B2) contains sign extension from bit 31 of the destination accumulator (A or B).
C is always set correctly by using accumulator source operands.
A-32
Add
Assembler Syntax:
(parallel move)
ADD
X0,A
X:(R0)+,Y0X:(R3)+,X0
0000
A0
DSP56800 Family Manual
S,D
(parallel move)
; 16-bit add, update
; Y0,X0,R0,R3
After Execution
0
00FF
A2
A1
X0
FFFF
ADD
0000
A0

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents