;FIRNC.ASM - GENERIC FIR FILTER. INCLUDE COEFFICIENTS FILE
        .start   ".text",0x809900   ;starting address of text 
        .start   ".data",0x809C00   ;starting address of data 
        .include "AICCOM31.ASM"     ;AIC communication routines
        .include "FIRCOF.COF"          ;coefficients file
        .data                       ;data section
XB_ADDR .word    XN+LENGTH-1        ;last (bottom) sample address
HN_ADDR .word    COEFF              ;starting addr of coefficients
AICSEC  .word    162ch,1h,3872h,67h ;AIC configuration data
        .brstart "XN_BUFF",64       ;align samples buffer
XN      .sect    "XN_BUFF"          ;buffer section for samples
        .loop    LENGTH             ;loop LENGTH times
        .float   0                  ;init samples buffer to zero
        .endloop                    ;end of loop
        .text                       ;text section
        .entry   BEGIN              ;start of code
BEGIN   LDP      AICSEC             ;init to data page 128
        CALL     AICSET             ;init AIC
LDI     LENGTH,BK                   ;BK=size of circular buffer
        LDI      @XB_ADDR,AR1       ;AR1=last sample address 
FILT    LDI      LENGTH-1,AR4       ;AR4=length-1 as loop counter
LOOP    CALL     AICIO_P            ;AICIO routine,IN->R6 OUT->R7

your code here.
