.def _lms_asm_init .def _lms_asm_intr .sect ".iprog" .ref _BETA _lms_asm_init MVKL 0x018C0000,B12 MVKH 0x018C0000,B12 MVKL _BETA, A12 MVKH _BETA, A12 ; This line is not necessary ZERO B1 ZERO B2 ZERO B3 ZERO B4 ZERO B5 ZERO B6 ZERO B7 ZERO B8 LDH *A12, A12 MVKL 0x0000ffff,A15 MVKH 0x0000ffff,A15 ; MVKL 0xffff0000,A14 MVKH 0xffff0000,A14 ; MVC CSR,B0 || SHL A12, 16, A12 OR 0X01,B0,B0 MVC B0,CSR loop B loop ; Wait for an interrupt nop 5 _lms_asm_intr zero A11 zero B11 LDH *B12,A0; Read the first element nop 5 SHL A0, 16, A0 SHR A0, 2, A1 MPYH B8,A8,A10 || MPYH B7,A7,B10 MPYH B6,A6,A10 || MPYH B5,A5,B10 ADD A10,A11,A11 || ADD B10,B11,B11 ADD A10,A11,A11 || ADD B10,B11,B11 MPYH B4,A4,A10 || MPYH B3,A3,B10 MPYH B2,A2,A10 || MPYH B1,A1,B10 ADD A10,A11,A11 || ADD B10,B11,B11 ADD A10,A11,A11 || ADD B10,B11,B11 ADD A11,B11,A11 SHL A11,1,A11 MV A11,B11 *Prepare the data to send out SHR B11, 16, b11 ;More gain A11 holds the output of the filter acc. and B11,A15,B11 and a0,a14,a10 add a10,B11,a0 STW A0,*B12[1] ;send out A0_B11 == X_in_Y NOP * E = D-SHORT(Y)>>15 SUB A1,A11,A11 ; The input is in A1 at this stage * _mpy(beta,E)>>15 MPYH A11,A12,A11; This line could be move obove the sub and the nop removed. NOP SHL A11, 1, A11 MV A11,B11 ; A11 =B11 *h[i] = h[i] + ((_mpy(BETA_E, X[i])) >>15 MPYH B11,A8,B10 || MPYH A11,A7,A10 MPYH B11,A6,B9 || MPYH A11,A5,A9 SHL B10,1,B10 || SHL A10,1,A10 ADD B10,B8,B8 || ADD B7,A10,B7 || MV A7,A8 SHL B9,1,B9 || SHL A9,1,A9 ADD B9,B6,B6 || ADD A9,B5,B5 || MV A6,A7 ************ MPYH B11,A4,B10 || MPYH A11,A3,A10 || MV A5,A6 MPYH B11,A2,B9 || MPYH A11,A1,A9 || MV A4,A5 SHL B10,1,B10 || SHL A10,1,A10 ADD B10,B4,B4 || ADD A10,B3,B3 || MV A3,A4 SHL B9,1,B9 || SHL A9,1,A9 || MV A2,A3 ADD B9,B2,B2 || ADD A9,B1,B1 || MV A1,A2 b .s2 IRP nop 5