Impy - Motorola DSP56800 Manual

16-bit digital signal processor
Table of Contents

Advertisement

IMPY(16)

Operation:
→ D1
(S1*S2)
sign-extend D2; leave D0 unchanged
Description: Perform an integer multiplication on the two 16-bit signed integer source operands (S1 and S2) and
store the lowest 16 bits of the integer product in the upper word (D1) of the destination accumulator
(D), leaving the lower word (D0) unchanged and sign extending the extension register (D2).
Usage:
This instruction is useful in general computing when it is necessary to multiply two integers and the
nature of the computation can guarantee that the result fits in a 16-bit destination. In this case, it is bet-
ter to place the result in the MSP (A1 or B1) of an accumulator, because more instructions have access
to this portion than to the other portions of the accumulator.
Note:
No overflow control or rounding is performed during integer multiply instructions. The result is always
a 16-bit signed integer result that is sign extended to 24 bits.
Example:
IMPY
Before Execution
F
AAAA
A2
A1
Explanation of Example:
Prior to execution, the data ALU registers X0 and Y0 contain, respectively, two 16-bit signed integer
values ($0003 and $0004). The contents of the destination accumulator are not important prior to ex-
ecution. Execution of the IMPY X0,Y0,A instruction integer multiplies X0 and Y0 and stores the re-
sult ($000C) in A1. A0 remains unchanged, and A2 is sign extended.
A-84
Integer Multiply
Assembler Syntax:
IMPY16
Y0,X0,A
; form product
789A
A0
X0
0003
Y0
0004
DSP56800 Family Manual
S1,S2,D (no parallel move)
After Execution
0
000C
A2
A1
X0
Y0
IMPY(16)
789A
A0
0003
0004

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents