	page 132,66,0,6
;********************************************
;Motorola Austin DSP Operation  June 30, 1988
;********************************************
;DSP96001/2
;Dot Product
;File name: 7-96
;**************************************************************************
;	Maximum execution time:  444.4ns at 27.0MHz (if z and x1 or x2 take 
;                                                    up the same location)
;	Memory Size: Prog: 7 words ; Data: 4 words 
;	Number of clock cycles:	  12 (6 instruction cycles)
;	Clock Frequency:	27.0 MHz
;	Cycle time:		74.1 ns
;**************************************************************************
;       This routine performs a dot product of two 2-dimensional 
;       vectors a and b for the DSP96000. 
;
;       Vector a is in X-memory, 
;       vector b is in Y memory,
;       the result z is stored in X memory.
;
;**************************************************************************
;     X Memory                     Y Memory
;
; |  | x2 |          |->|  y2 |
; |->| x1 |          |->|  y1 |
; r0 |    |          r0 |     |
;
; |->|  z |             
;
;
;Note: the previous assumes that all immediate addressing is
;immediate short, i.e. all data is in internal memory.
;
veca    equ     $0100
z       equ     $0100

        org     x:veca
        dc      $600000
        dc      $400000

        org     y:veca
        dc      $300000
        dc      $100000

        org     p:$40

;**************************************************************************
        move #veca,r0                                   ;point to a and b
        move #z,r1                                      ;point to z
        fmove                     x:(r0)+,d4   y:()+,d5 ;load a1 and b1
        fmpy d4,d5,d0             x:(r0)+,d4   y:()+,d5 ;a1*b1
        fmpy d4,d5,d1                                   ;a2*b2
                      faddr d0,d1                       ;(a1*b1)+(a2*b2)
        fmove                     d1,x:(r0)+            ;--> z
;**************************************************************************
        end


