Motorola DSP56800 Manual page 258

16-bit digital signal processor
Table of Contents

Advertisement

ABS
Operation:
|D| → D
(parallel move)
Description: Take the absolute value of the destination operand (D) and store the result in the destination accumu-
lator.
Example:
ABS
A Before Execution
F
FFFF
A2
A1
Explanation of Example:
Prior to execution, the 36-bit A accumulator contains the value $F:FFFF:FFF2. Since this is a negative
number, the execution of the ABS instruction takes the two's-complement of that value and returns
$0:0000:000E.
Note:
When the D operand equals $8:0000:0000 (-16.0 when interpreted as a decimal fraction), the ABS in-
struction will cause an overflow to occur since the result cannot be correctly expressed using the stan-
dard 36-bit, fixed-point, two's-complement data representation. Data limiting does not occur (that is,
A is not set to the limiting value of $7:FFFF:FFFF) but remains unchanged.
Condition Codes Affected:
15
14
LF
*
A-28
Absolute Value
A
X:(R0)+,Y0
FFF2
A0
MR
13
12
11
10
9
*
*
*
*
I1
SZ — Set according to the standard definition of the SZ bit (parallel move)
L
— Set if limiting (parallel move) or overflow has occurred in result
E
— Set if the signed integer portion of A or B result is in use
U
— Set according to the standard definition of the U bit
N
— Set if bit 35 of A or B result is set except during saturation.
Z
— Set if A or B result equals zero
V
— Set if overflow has occurred in A or B result
DSP56800 Family Manual
Assembler Syntax:
ABS
D
; take ABS value, move data into Y0,
; update R0
A After Execution
0
0000
A2
A1
CCR
8
7
6
5
4
SZ
L
E
U
I0
ABS
(parallel move)
000E
A0
3
2
1
0
N
Z
V
C

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents