dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 310

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
IMPY(16)
Operation:
(S1*S2) → D1
sign-extend D2; leave D0 unchanged
Description: Perform an integer multiplication on the two 16-bit, signed, integer source operands (S1 and S2), and
Usage:
Note:
Example:
Explanation of Example:
A-80
Before Execution
A2
F
store the lowest 16 bits of the integer product in the destination (D). If the destination is an accumula-
tor, the product is stored in the MSP with sign extension while the LSP remains unchanged. The order
of the first two operands is not important. The V bit is set if the calculated integer product does not fit
into 16 bits.
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.
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 20 bits.
IMPY16
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.
AAAA
A1
X0
Y0
Y0,X0,A
789A
0003
0004
A0
DSP56800 Family Manual
Integer Multiply
Assembler Syntax:
IMPY16
; form 16-bit product
After Execution
A2
0
S1,S2,D
000C
A1
X0
Y0
IMPY(16)
Freescale Semiconductor
789A
0003
0004
A0

Related parts for dsp56800