.def _gain_c55x _gain_c55x 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 bset SATA mov *AR1<<16,AC0 ; get the sample from 'in_buffer' mpy T0,AC0,AC1 ; multiply by the gain factor mov rnd(hi(AC1)),*AR0 ; store it to the 'out' variable BCLR FRCT BCLR SATD BCLR SXMD BCLR SATA BCLR SMUL popm ST3_55 ; restore ST1, ST2, and ST3 popm ST2_55 popm ST1_55 ret .end