Listing 1 for DI #2313: "RISC [lmu]P implements fast FIR filter" by Sorin Zarnescu, NEC Electronics, Santa Clara, CA ************************************************************************ .data .align 4 .global M1,M2,M3,M4,New c1 .set 0x00; coef 1 c2 .set 0x10; coef 2 c3 .set 0x20; coef 3 c4 .set 0x30; coef 4 M1 .hword 0x0010 ; first sample M2 .hword 0x0020 ; second sample M3 .hword 0x0030 ; third sample M4 .hword 0x0040 ; fourth sample New .hword 0x0050 ;new sample - written by the interrupt routine .text .align 4 ld.h M1[r0],r1; load first sample into register 1 ld.h M2,[r0]r2; load second sample into register 2 muli c1,r1,r1 ;(coef 1 x sample 1) --> accumulator st.h r1,M1[r0] ; store first sample into the second memory location ld.h M3[r0],r3; load third sample into register 3 maci c2,r2,r1 ; (coef 2 x sample 2) + accumulator --> accumulator st.h r2,M3[r0] ; store second sample into third memory location ld.h M4[r0],r4 ; load lst sample maci c3,r3,r1 ; (coef 3 x sample 3) + accumulator --> accumulator st.h r3,M4[r0] ; store third sample into last memory location maci c4,r4,r1; (coef 4 x sample 4) + accumulator --> accumulator