;********************************************************** ; fir_c55 - TMS320C55x assembly routine that can be called ; from C main program ; This function can be called as follows: ; yn = fir_c55(xnbuf,BL,B); ; where ; xnbuf - signal vector ; BL - length of FIR filter ; B - coefficient vector ;********************************************************** .def _fir_c55 .text _fir_c55 pshm ST1_55 ; save ST1, ST2, and ST3 pshm ST2_55 pshm ST3_55 or #0x340,mmap(ST1_55); set FRCT,SXMD,SATD bset SMUL ; set SMUL sub #2,T0 ; T0=BL-2 mov T0,CSR ; repeat CSR BL-1 times rpt CSR ; repeat the next instruction macm *AR0+,*AR1+,AC0 ; MAC macmr *AR0,*AR1,AC0 ; do the last operation mov hi(AC0),T0 ; save Q15 filtered value popm ST3_55 ; restore ST1, ST2, and ST3 popm ST2_55 popm ST1_55 ; return signal buffer index ret .end