; .............................................................................. ; File proba.s ; .............................................................................. .equ probaNumTaps, 64 ; .............................................................................. ; Allocate and initialize filter taps .section .xdata .align 128 probaTaps: .hword 0xFED3, 0x0057, 0x0100, 0xFEE1, 0xFFCB, 0x0160, 0xFF2E, 0xFF26, 0x018D .hword 0xFFBF, 0xFE83, 0x0170, 0x0089, 0xFDFF, 0x00F8, 0x017F, 0xFDBD, 0x0015 .hword 0x0289, 0xFDE5, 0xFEB7, 0x038D, 0xFEAC, 0xFCB6, 0x046F, 0x008A, 0xF97D .hword 0x0515, 0x056D, 0xF144, 0x056D, 0x3DB7, 0x3DB7, 0x056D, 0xF144, 0x056D .hword 0x0515, 0xF97D, 0x008A, 0x046F, 0xFCB6, 0xFEAC, 0x038D, 0xFEB7, 0xFDE5 .hword 0x0289, 0x0015, 0xFDBD, 0x017F, 0x00F8, 0xFDFF, 0x0089, 0x0170, 0xFE83 .hword 0xFFBF, 0x018D, 0xFF26, 0xFF2E, 0x0160, 0xFFCB, 0xFEE1, 0x0100, 0x0057 .hword 0xFED3 ; .............................................................................. ; Allocate delay line in (uninitialized) Y data space .section .ybss, "b" .align 128 probaDelay: .space probaNumTaps*2 ; .............................................................................. ; Allocate and intialize filter structure .section .data .global _probaFilter _probaFilter: .hword probaNumTaps .hword probaTaps .hword probaTaps+probaNumTaps*2-1 .hword 0xff00 .hword probaDelay .hword probaDelay+probaNumTaps*2-1 .hword probaDelay ; .............................................................................. ; .............................................................................. ; Sample assembly language calling program ; The following declarations can be cut and pasted as needed into a program ; .extern _FIRFilterInit ; .extern _BlockFIRFilter ; .extern _probaFilter ; ; .section .bss ; ; The input and output buffers can be made any desired size ; the value 40 is just an example - however, one must ensure ; that the output buffer is at least as long as the number of samples ; to be filtered (parameter 4) ;input: .space 40 ;output: .space 40 ; .text ; ; ; This code can be copied and pasted as needed into a program ; ; ; Set up pointers to access input samples, filter taps, delay line and ; output samples. ; mov #_probaFilter, W0 ; Initalize W0 to filter structure ; call _FIRFilterInit ; call this function once ; ; The next 4 instructions are required prior to each subroutine call ; to _BlockFIRFilter ; mov #_probaFilter, W0 ; Initalize W0 to filter structure ; mov #input, W1 ; Initalize W1 to input buffer ; mov #output, W2 ; Initalize W2 to output buffer ; mov #20, W3 ; Initialize W3 with number of required output samples ; call _BlockFIRFilter ; call as many times as needed