Motorola DSP96002 User Manual
Page 647
B-128
DSP96002 USER’S MANUAL
MOTOROLA
dc .5,.5,.5,.5
dc .5,.5,.5,.5
dc .5,.5,.5,.5
org p:$100
move #amatrix,r0 1 1
move #N,n0 1 1
move #N_sqr-1,m0 ; modulo N-squared addressing 1 1
move #bmatrix,r4 1 1
move #cmatrix,r1 1 1
move n0,n4 1 1
move m0,m4 1 1
move n0,n1 1 1
move m0,m1 1 1
fclr d1 x:(r0)+,d0.s y:(r4)+n4,d4.s 1 1
fclr d3 d1.s,d7.s 1 1
do #N,endall 2 3
do #N,endcol 2 3
rep #N 1 2
fmpy d0,d4,d3 fadd.s d3,d1 x:(r0)+,d0.s y:(r4)+n4,d4.s 1 1
fadd.s d3,d1 d7.s,d3.s 1 1
fclr d1 d1.s,x:(r1)+n1 1 1
endcol
move (r4)+ ; increment r4 1 1
move (r1)+ ; increment r1 1 1
endall --- ---
Totals: 21 n**3
+4n**2
+5n
+16
B.1.55
[4x4] by [4x4] Matrix Multiplication (Modulo-Aligned)
;This routine performs a [4x4] by [4x4] matrix multiplication
;for the 96000 floating-point DSP chip. Sample data is given.
;The data for all matrices is stored in row major
;format. For example, take the matrix A:
;
; A(1,1) ... A(1,N)
; . . .
; . . .
; A(N,1) ... A(N,N)
;
;Matrix A’s elements are stored as such: