Motorola DSP96002 User Manual page 715

32-bit digital signal processor
Table of Contents

Advertisement

;
;
; Outputs:
r0 contains the lowest address of the 4-word internal
;
;
; Alters:
D0.L,D1.L,D2.L,D3.L,D4.L,D5.L,D6.L,D7.L,D0.H,D1.H
;
dp_sub
jsr
jsr
jmp
;
; MOTOROLA DSP96002 DPLIB - VERSION 1.0
;
; DP_TST - Test a double precision operand.
;
; Entry point:
;
; Inputs:
r0 contains the lowest address of the 4-word internal
;
;
; Outputs:
none
;
; CCR CONDITION CODES:
;
;
C - NOT AFFECTED.
;
V - ALWAYS CLEARED
;
Z - SET IF RESULT IS ZERO, CLEARED OTHERWISE.
;
N - SET IF RESULT IS NEGATIVE, CLEARED OTHERWISE.
;
I - NOT AFFECTED.
;
LR - NOT AFFECTED.
;
R - NOT AFFECTED.
;
A - NOT AFFECTED.
;
;
The following Jcc branch conditions can be used after
;
calling dp_tst.
;
be used.
;
;
"cc" Mnemonic
;
EQ - equal
;
GE - greater than or equal
;
GT - greater than
;
LE - less than or equal
;
LT - less than
;
NE - not equal
;
; Alters:
D0.L,D1.L,D2.L
;
dp_tst
move
tst
jeq
sgntst
tst
move
add
B-196
extended precision number
extended precision number with the result
dp_neg
dp_add
dp_neg
dp_tst:
c(r0) - 0
extended precision number
The other branch conditions should not
x:(r0+ms),d0.l
d0
x:(r0+sign),d1.l
mszero
d1
#-1,d0.l
#2,d1.l
d1,d0
ifeq
DSP96002 USER'S MANUAL
;negate the operand
;add the numbers
;negate the operand
(The same as "TST.")
(Set the flags)
Condition
Z = 1
N eor V = 0
Z + (N eor V) = 0
Z + (N eor V) = 1
N eor V = 1
Z = 0
;get ms
;test ms = 0, get sign
;if zero, check if ls = 0
;test the sign
;get offset for negative sign
;make d0 same sign as (r0)
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents