Motorola DSP96002 User Manual page 716

32-bit digital signal processor
Table of Contents

Advertisement

tst
rts
mszero
move
tst
jne
tst
rts
;
; END OF DPLIB
;
end
;
;
;
"data" and "coef" are assumed to be in DPLIB format.
;
Other variables are assumed to be in IEEE DP format.
;
org
ntaps
equ
data
ds
coef
ds
p
ds
a
ds
ieee_in
ds
ieee_out ds
;
org
start
move
move
move
move
move
move
move
move
_loop
move
move
jsr
do
move
move
jsr
move
move
jsr
move
move
_dpfir
move
jsr
MOTOROLA
d0
x:(r0+ls),d0.l
d0
#0,d2.l
sgntst
d2
Double precision FIR example
x:0
8
4*ntaps
4*ntaps
1
1
1
1
p:$100
#data,r2
;point to data
#coef,r3
;point to coefficients
#p,r4
;temp product
#a,r5
;product accumulator
#4,n2
;dp size
n2,n3
#4*ntaps-1,m2
;mod buffer size
m2,m3
l:ieee_in,d0.d
;get ieee number
r2,r0
;point r0 to data buffer
ieee2dplib
;convert register to dp and save
#ntaps,_dpfir
r4,r0
;point to product variable
r3,r1
;point to coefficients
dp_mpy
;multiply, result in p
r5,r0
;point to accumulations
r4,r1
;point to product variable
dp_add
;add them together
(r2)+n2
;shift to next dp data value
(r3)+n3
;move to next dp coefficient
r5,r0
;point to result
dplib2ieee
;convert to a value in d0
DSP96002 USER'S MANUAL
;set the correct flags
;get ls
;check if ls = 0
;if not, check sign
;set the correct flags
B-197

Advertisement

Table of Contents
loading

Table of Contents