dsp56000 Freescale Semiconductor, Inc, dsp56000 Datasheet - Page 340

no-image

dsp56000

Manufacturer Part Number
dsp56000
Description
24-bit Digital Signal Processor Family Manual
Manufacturer
Freescale Semiconductor, Inc
Datasheet
Operation:
Description: Subtract the absolute value (magnitude) of the source one operand, S1,
from the absolute value of the source two accumulator, S2, and update the condition
code register. The result of the subtraction operation is not stored.
Note: This instruction subtracts 56-bit operands. When a word is specified as S1, it is
sign extended and zero filled to form a valid 56-bit operand. For the carry to be set cor-
rectly as a result of the subtraction, S2 must be properly sign extended. S2 can be
improperly sign extended by writing A1 or B1 explicitly prior to executing the compare so
that A2 or B2, respectively, may not represent the correct sign extension. This note par-
ticularly applies to the case where it is extended to compare 24-bit operands such as X0
with A1.
Example:
Explanation of Example: Prior to execution, the 56-bit A accumulator contains the
value $00:000006:000000, and the 24-bit X1 register contains the value $FFFFF7. The
execution of the CMPM X1,A instruction automatically appends the 24-bit value in the X1
register with 24 LS zeros, sign extends the resulting 48-bit long word to 56 bits, takes the
absolute value of the resulting 56-bit number, subtracts the result from the absolute
value of the contents of the 56-bit A accumulator, and updates the condition code regis-
ter.
A - 74
CMPM
|S2| – |S1|(parallel move)
CMPM X1,A
X1
SR
A
:
:
$00:000006:000000
Before Execution
Freescale Semiconductor, Inc.
BA,L:–(R4)
For More Information On This Product,
$FFFFF7
INSTRUCTION DESCRIPTIONS
$0300
INSTRUCTION SET DETAILS
Go to: www.freescale.com
Compare Magnitude
Assembler Syntax:
X1
SR
A
CMPM
;comp. Y0 and B, save X0, Y1
$00:000006:000000
After Execution
S1, S2 (parallel move)
$FFFFF7
$0319
CMPM
MOTOROLA

Related parts for dsp56000