Motorola DSP96002 User Manual
Page 615
B-96
DSP96002 USER’S MANUAL
MOTOROLA
; Multiply coordinates by 1/W, scale and add offset (old point)
fmpy.s d0,d4,d2 ; 1 1
fmpy.s d2,d1,d2 x:(r4)-,d4.s y:,d6.s ;Ys Yf 1 1
fmpy d5,d4,d3 fadd.s d3,d2 ; 1 1
fmpy.s d3,d1,d3 d2.s,y:(r5)+ ; X1 1 1
fadd.s d6,d3 y:(r1)+n1,d2.s ; Wn 1 1
move d3.s,y:(r5)+ ; Y1 1 1
; Calculate reciprocal 1/W (new point)
fseedd d2,d6 ; 1 1
fmpy.s d2,d6,d1 d9.s,d4.s ; 1 1
fsub.s d1,d4 d4.s,d3.s d2.s,y:(r1)+ ; Wo 1 1
fmpy.s d1,d4,d1 x:(r1)+n1,d0.s y:,d2.s ;Xn Zn 1 1
fmpy d6,d4,d1 fsub.s d1,d3 d0.s,x:(r1)- d2.s,y: ;Xo Zo 1 1
fmpy.s d1,d3,d1 x:(r4)+,d4.s y:,d3.s ;Xs Xf 1 1
; Multiply coordinates by 1/W, scale and add offset (new point)
fmpy.s d0,d4,d2 x:(r1)+n1,d5.s ;Yn 1 1
fmpy.s d2,d1,d2 x:(r4)+,d4.s y:,d6.s ;Ys Yf 1 1
fmpy d5,d4,d0 fadd.s d3,d2 d5.s,x:(r1)+ ;Yo 1 1
fmpy.s d0,d1,d5 x:(r0)+,d0.s d2.s,y:(r5)+ ;X X1 1 1
fadd.s d5,d3 x:(r6),d7.l ;Cnt 1 1
dec d7 d3.s,y:(r5)+ ; Y1 1 1
jne _accept_loop ; 2 2
jmp _end ; 2 2