Vector Dot Product with Pipeline Effects
; clear A4 and initialize pointers A5, A6, and A7
MVK .S1 40,A2 ; A2 = 40 (loop counter)
loop LDH .D1 *A5++,A0 ; A0 = a(n)
LDH .D1 *A6++,A1 ; A1 = x(n)
MPY .M1 A0,A1,A3 ; A3 = a(n) * x(n)
ADD .L1 A3,A4,A4 ; Y = Y + A3
SUB .L1 A2,1,A2 ; decrement loop counter
[A2] B .S1 loop ; if A2 != 0, then branch
Assembler will automatically insert NOP instructions
Assembler can also make sequential code parallel