; ..............................................................................
;    File   BandpassIR0.s
; ..............................................................................

		.equ BandpassIR0NumTaps, 201

; ..............................................................................
; Allocate and initialize filter taps

		.section .xdata, data, xmemory
		.align 512

BandpassIR0Taps:
.hword 	0x0000,	0x0000,	0x0000,	0xFFFF,	0xFFFE,	0xFFFD,	0xFFFC,	0xFFFB,	0xFFF9
.hword 	0xFFF8,	0xFFF6,	0xFFF4,	0xFFF2,	0xFFEF,	0xFFED,	0xFFEA,	0xFFE7,	0xFFE4
.hword 	0xFFE1,	0xFFDD,	0xFFD9,	0xFFD6,	0xFFD2,	0xFFCE,	0xFFC9,	0xFFC5,	0xFFC1
.hword 	0xFFBC,	0xFFB8,	0xFFB4,	0xFFB0,	0xFFAB,	0xFFA8,	0xFFA4,	0xFFA0,	0xFF9D
.hword 	0xFF9A,	0xFF97,	0xFF95,	0xFF93,	0xFF92,	0xFF91,	0xFF91,	0xFF92,	0xFF93
.hword 	0xFF95,	0xFF97,	0xFF9B,	0xFF9F,	0xFFA4,	0xFFAA,	0xFFB1,	0xFFB9,	0xFFC2
.hword 	0xFFCB,	0xFFD6,	0xFFE2,	0xFFEF,	0xFFFC,	0x000A,	0x0019,	0x002A,	0x003B
.hword 	0x004D,	0x0060,	0x0074,	0x0089,	0x009E,	0x00B4,	0x00CA,	0x00E1,	0x00F9
.hword 	0x0110,	0x0128,	0x0141,	0x0159,	0x0171,	0x0189,	0x01A1,	0x01B9,	0x01D1
.hword 	0x01E8,	0x01FE,	0x0214,	0x0229,	0x023E,	0x0251,	0x0264,	0x0275,	0x0286
.hword 	0x0295,	0x02A3,	0x02B0,	0x02BB,	0x02C5,	0x02CD,	0x02D4,	0x02DA,	0x02DE
.hword 	0x02E0,	0x02E1,	0x02E0,	0x02DE,	0x02DA,	0x02D4,	0x02CD,	0x02C5,	0x02BB
.hword 	0x02B0,	0x02A3,	0x0295,	0x0286,	0x0275,	0x0264,	0x0251,	0x023E,	0x0229
.hword 	0x0214,	0x01FE,	0x01E8,	0x01D1,	0x01B9,	0x01A1,	0x0189,	0x0171,	0x0159
.hword 	0x0141,	0x0128,	0x0110,	0x00F9,	0x00E1,	0x00CA,	0x00B4,	0x009E,	0x0089
.hword 	0x0074,	0x0060,	0x004D,	0x003B,	0x002A,	0x0019,	0x000A,	0xFFFC,	0xFFEF
.hword 	0xFFE2,	0xFFD6,	0xFFCB,	0xFFC2,	0xFFB9,	0xFFB1,	0xFFAA,	0xFFA4,	0xFF9F
.hword 	0xFF9B,	0xFF97,	0xFF95,	0xFF93,	0xFF92,	0xFF91,	0xFF91,	0xFF92,	0xFF93
.hword 	0xFF95,	0xFF97,	0xFF9A,	0xFF9D,	0xFFA0,	0xFFA4,	0xFFA8,	0xFFAB,	0xFFB0
.hword 	0xFFB4,	0xFFB8,	0xFFBC,	0xFFC1,	0xFFC5,	0xFFC9,	0xFFCE,	0xFFD2,	0xFFD6
.hword 	0xFFD9,	0xFFDD,	0xFFE1,	0xFFE4,	0xFFE7,	0xFFEA,	0xFFED,	0xFFEF,	0xFFF2
.hword 	0xFFF4,	0xFFF6,	0xFFF8,	0xFFF9,	0xFFFB,	0xFFFC,	0xFFFD,	0xFFFE,	0xFFFF
.hword 	0x0000,	0x0000,	0x0000

; ..............................................................................
; Allocate delay line in (uninitialized) Y data space

		.section .ybss, bss, ymemory
		.align 512

BandpassIR0Delay:
		.space BandpassIR0NumTaps*2

; ..............................................................................
; Allocate and intialize filter structure

		.section .data
		.global _BandpassIR0Filter

_BandpassIR0Filter:
.hword BandpassIR0NumTaps
.hword BandpassIR0Taps
.hword BandpassIR0Taps+BandpassIR0NumTaps*2-1
.hword 0xff00
.hword BandpassIR0Delay
.hword BandpassIR0Delay+BandpassIR0NumTaps*2-1
.hword BandpassIR0Delay

; ..............................................................................
; ..............................................................................
; Sample assembly language calling program
;  The following declarations can be cut and pasted as needed into a program
;		.extern	_FIRFilterInit
;		.extern	_FIR
;		.extern	_BandpassIR0Filter
;
;		.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 1)
;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	#_BandpassIR0Filter, W0	; Initalize W0 to filter structure
;		call	_FIRDelayInit	; call this function once
;
; The next 4 instructions are required prior to each subroutine call
; to _FIR
;		mov	#_BandpassIR0Filter, W3	; Initalize W3 to filter structure
;		mov	#input, W2	; Initalize W2 to input buffer 
;		mov	#output, W1	; Initalize W1 to output buffer
;		mov	#20, W0	; Initialize W0 with number of required output samples
;		call	_FIR	; call as many times as needed
