move
nop
fclr
do
fmpy
fmpy
fmpy
fmpy.s
fmpy
loop
move
B.1.51
Four Quadrant Trigonometric SINE (CORDIC Algorithm)
page
opt
mex,cex
tabsize
equ
org
x:0
scale
set
tantab
tanarg
set
dup
scale
set
dc
tanarg
set
endm
org
p:$100
;
;
Do argument reduction, input in d6 in degrees
;
move
fadd.x
d7,d6
fmpy.x
d5,d6,d6
floor
d6,d5
fsub.x
d5,d6
fmpy.x
d5,d6,d6
fadd.x
d7,d6
;
;
Input angle in d6 in degrees, -180 < d6 < 180
;
fabs.x
d6
B-122
#coef,r4
d1
#nsec,loop
d4,d6,d0
fadd.s d1,d2
d5,d6,d1
fadd.s d2,d0
d6,d4,d1
fadd.s d1,d0
d6,d5,d2
d4,d0,d1
fadd.s d1,d2
d2.s,y:output
132,60,1,1
16
1.0
45.0*3.14159/180.0
tabsize
scale*@cos(tanarg)
@tan(tanarg)
tanarg/2.0
#-180.0,d7.s
#1.0/360.0,d5.s
#360.0,d5.s
d6.s,d3.s
DSP96002 USER'S MANUAL
x:(r0)+,d4.s
y:(r4)+,d6.s 1
x:(r0)-,d5.s
y:(r4)+,d6.s 1
d5.s,x:(r0)+
y:(r4)+,d6.s 1
y:(r4)+,d6.s 1
d0.s,x:(r0)+
y:(r4)+,d4.s 1
x:(r0)+,d4.s
y:(r4)+,d6.s 1
Totals:
;get range min
;adjust to min, get range
;reduce range
;get int part
;get frac part, spread
;spread fraction part to range
;adjust to min
;make positive, save sign
1
2
3
1
1
1
1
1
---
---
8
5N+4
MOTOROLA