BENCHMARK PROGRAMS
B - 8 BENCHMARK PROGRAMS
MOTOROLA
;
;
;
;*********************************************************************************************************************
;
; initialization
;****************************************
n equ 20
start equ $40
wddr equ $0
cddr equ $0
input equ $ffe0
output equ $ffe1
;org p:start
move #wddr,r0 ;r0 samples
move #cddr,r4 ;r1 coefficients
move #n-1,m0 ;set modulo arithmetic
move m0,m4 ;for the 2 circular buffers
;opt cc
; filter loop :8+(n-1) cycles
;**********************************************************************************************************************
movep y:input,x: (r0) ;input sample in memory
clr a x:(r0)+,x0 y: (r4)+,y0
rep #n-1
mac x0,y0,a x:(r0)+,x0 y:(r4)+,y0
macr x0,x0,a (r0)-
movep a,y:output ;output filtered sample
;*********************************************************************************************************************
end
Figure B-1 20-Tap FIR Filter Example (Sheet 2 of 2)