; TMS320C54x assembly language code ; Block FIR filtering ; Addresses: a4 h, a5 N samples of x, a6 input buffer, a7 output buffer ; Modulo addressing prevents need to reinitialize regs each sample ; Moving filter coefficients from program to data memory is not shown ; Example taken from the C54x Applications Guide, pages 4-3 and 4-4. firtask: ld #firDP,dp ; initialize data page pointer stm #frameSize-1,brc ; compute 256 outputs rptbd firloop-1 stm #N,bk ; FIR circular buffer size ld *ar6+,a ; load input value to accumulator b stl a,*ar4+% ; replace oldest sample with newest rptz a,#(N-1) ; zero accumulator a, do N taps mac *ar4+0%,*ar5+0%,a ; one tap, accumulate in a sth a,*ar7+ ; store y[n] firloop: ret