; ..............................................................................
;    File   Bandpass250IR.s
; ..............................................................................

		.equ Bandpass250IRNumTaps, 513

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

		.section .xdata, data, xmemory
		.align 2048

Bandpass250IRTaps:
.hword 	0x0000,	0x0000,	0x0000,	0x0000,	0x0000,	0x0001,	0x0001,	0x0001,	0x0002
.hword 	0x0002,	0x0003,	0x0003,	0x0003,	0x0004,	0x0004,	0x0004,	0x0004,	0x0004
.hword 	0x0004,	0x0004,	0x0004,	0x0004,	0x0003,	0x0003,	0x0002,	0x0002,	0x0001
.hword 	0x0000,	0x0000,	0xFFFF,	0xFFFE,	0xFFFD,	0xFFFC,	0xFFFB,	0xFFFA,	0xFFF9
.hword 	0xFFF8,	0xFFF8,	0xFFF7,	0xFFF6,	0xFFF6,	0xFFF6,	0xFFF6,	0xFFF6,	0xFFF7
.hword 	0xFFF7,	0xFFF8,	0xFFF9,	0xFFFA,	0xFFFB,	0xFFFC,	0xFFFD,	0xFFFE,	0x0000
.hword 	0x0000,	0x0001,	0x0003,	0x0004,	0x0005,	0x0005,	0x0006,	0x0006,	0x0006
.hword 	0x0006,	0x0006,	0x0005,	0x0004,	0x0003,	0x0001,	0x0000,	0xFFFE,	0xFFFB
.hword 	0xFFF9,	0xFFF6,	0xFFF3,	0xFFF0,	0xFFED,	0xFFEA,	0xFFE7,	0xFFE4,	0xFFE2
.hword 	0xFFDF,	0xFFDD,	0xFFDB,	0xFFDA,	0xFFD9,	0xFFD8,	0xFFD8,	0xFFD8,	0xFFD9
.hword 	0xFFDA,	0xFFDC,	0xFFDE,	0xFFE0,	0xFFE3,	0xFFE5,	0xFFE9,	0xFFEC,	0xFFEF
.hword 	0xFFF2,	0xFFF6,	0xFFF9,	0xFFFC,	0xFFFE,	0x0000,	0x0001,	0x0002,	0x0002
.hword 	0x0002,	0x0002,	0x0000,	0xFFFF,	0xFFFC,	0xFFF9,	0xFFF5,	0xFFF0,	0xFFEB
.hword 	0xFFE5,	0xFFDF,	0xFFD9,	0xFFD2,	0xFFCC,	0xFFC5,	0xFFBF,	0xFFB8,	0xFFB2
.hword 	0xFFAD,	0xFFA8,	0xFFA4,	0xFFA1,	0xFF9E,	0xFF9C,	0xFF9C,	0xFF9C,	0xFF9D
.hword 	0xFFA0,	0xFFA3,	0xFFA7,	0xFFAC,	0xFFB2,	0xFFB8,	0xFFBF,	0xFFC6,	0xFFCD
.hword 	0xFFD5,	0xFFDD,	0xFFE4,	0xFFEB,	0xFFF1,	0xFFF7,	0xFFFB,	0xFFFF,	0x0000
.hword 	0x0002,	0x0001,	0x0000,	0xFFFE,	0xFFFA,	0xFFF4,	0xFFED,	0xFFE4,	0xFFDB
.hword 	0xFFD0,	0xFFC4,	0xFFB8,	0xFFAB,	0xFF9D,	0xFF90,	0xFF83,	0xFF76,	0xFF6A
.hword 	0xFF5E,	0xFF54,	0xFF4B,	0xFF43,	0xFF3E,	0xFF3A,	0xFF38,	0xFF38,	0xFF3A
.hword 	0xFF3E,	0xFF45,	0xFF4D,	0xFF57,	0xFF64,	0xFF72,	0xFF81,	0xFF91,	0xFFA2
.hword 	0xFFB4,	0xFFC6,	0xFFD8,	0xFFE9,	0xFFF9,	0x0007,	0x0015,	0x0020,	0x002A
.hword 	0x0030,	0x0034,	0x0035,	0x0033,	0x002D,	0x0025,	0x0018,	0x0009,	0xFFF7
.hword 	0xFFE2,	0xFFC9,	0xFFAF,	0xFF92,	0xFF74,	0xFF54,	0xFF34,	0xFF14,	0xFEF5
.hword 	0xFED6,	0xFEBA,	0xFE9F,	0xFE88,	0xFE74,	0xFE65,	0xFE5A,	0xFE54,	0xFE54
.hword 	0xFE59,	0xFE65,	0xFE78,	0xFE91,	0xFEB1,	0xFED8,	0xFF05,	0xFF38,	0xFF72
.hword 	0xFFB1,	0xFFF5,	0x003D,	0x008A,	0x00DA,	0x012D,	0x0182,	0x01D7,	0x022D
.hword 	0x0281,	0x02D4,	0x0324,	0x0371,	0x03B9,	0x03FC,	0x0439,	0x0470,	0x049F
.hword 	0x04C6,	0x04E6,	0x04FC,	0x050A,	0x050E,	0x050A,	0x04FC,	0x04E6,	0x04C6
.hword 	0x049F,	0x0470,	0x0439,	0x03FC,	0x03B9,	0x0371,	0x0324,	0x02D4,	0x0281
.hword 	0x022D,	0x01D7,	0x0182,	0x012D,	0x00DA,	0x008A,	0x003D,	0xFFF5,	0xFFB1
.hword 	0xFF72,	0xFF38,	0xFF05,	0xFED8,	0xFEB1,	0xFE91,	0xFE78,	0xFE65,	0xFE59
.hword 	0xFE54,	0xFE54,	0xFE5A,	0xFE65,	0xFE74,	0xFE88,	0xFE9F,	0xFEBA,	0xFED6
.hword 	0xFEF5,	0xFF14,	0xFF34,	0xFF54,	0xFF74,	0xFF92,	0xFFAF,	0xFFC9,	0xFFE2
.hword 	0xFFF7,	0x0009,	0x0018,	0x0025,	0x002D,	0x0033,	0x0035,	0x0034,	0x0030
.hword 	0x002A,	0x0020,	0x0015,	0x0007,	0xFFF9,	0xFFE9,	0xFFD8,	0xFFC6,	0xFFB4
.hword 	0xFFA2,	0xFF91,	0xFF81,	0xFF72,	0xFF64,	0xFF57,	0xFF4D,	0xFF45,	0xFF3E
.hword 	0xFF3A,	0xFF38,	0xFF38,	0xFF3A,	0xFF3E,	0xFF43,	0xFF4B,	0xFF54,	0xFF5E
.hword 	0xFF6A,	0xFF76,	0xFF83,	0xFF90,	0xFF9D,	0xFFAB,	0xFFB8,	0xFFC4,	0xFFD0
.hword 	0xFFDB,	0xFFE4,	0xFFED,	0xFFF4,	0xFFFA,	0xFFFE,	0x0000,	0x0001,	0x0002
.hword 	0x0000,	0xFFFF,	0xFFFB,	0xFFF7,	0xFFF1,	0xFFEB,	0xFFE4,	0xFFDD,	0xFFD5
.hword 	0xFFCD,	0xFFC6,	0xFFBF,	0xFFB8,	0xFFB2,	0xFFAC,	0xFFA7,	0xFFA3,	0xFFA0
.hword 	0xFF9D,	0xFF9C,	0xFF9C,	0xFF9C,	0xFF9E,	0xFFA1,	0xFFA4,	0xFFA8,	0xFFAD
.hword 	0xFFB2,	0xFFB8,	0xFFBF,	0xFFC5,	0xFFCC,	0xFFD2,	0xFFD9,	0xFFDF,	0xFFE5
.hword 	0xFFEB,	0xFFF0,	0xFFF5,	0xFFF9,	0xFFFC,	0xFFFF,	0x0000,	0x0002,	0x0002
.hword 	0x0002,	0x0002,	0x0001,	0x0000,	0xFFFE,	0xFFFC,	0xFFF9,	0xFFF6,	0xFFF2
.hword 	0xFFEF,	0xFFEC,	0xFFE9,	0xFFE5,	0xFFE3,	0xFFE0,	0xFFDE,	0xFFDC,	0xFFDA
.hword 	0xFFD9,	0xFFD8,	0xFFD8,	0xFFD8,	0xFFD9,	0xFFDA,	0xFFDB,	0xFFDD,	0xFFDF
.hword 	0xFFE2,	0xFFE4,	0xFFE7,	0xFFEA,	0xFFED,	0xFFF0,	0xFFF3,	0xFFF6,	0xFFF9
.hword 	0xFFFB,	0xFFFE,	0x0000,	0x0001,	0x0003,	0x0004,	0x0005,	0x0006,	0x0006
.hword 	0x0006,	0x0006,	0x0006,	0x0005,	0x0005,	0x0004,	0x0003,	0x0001,	0x0000
.hword 	0x0000,	0xFFFE,	0xFFFD,	0xFFFC,	0xFFFB,	0xFFFA,	0xFFF9,	0xFFF8,	0xFFF7
.hword 	0xFFF7,	0xFFF6,	0xFFF6,	0xFFF6,	0xFFF6,	0xFFF6,	0xFFF7,	0xFFF8,	0xFFF8
.hword 	0xFFF9,	0xFFFA,	0xFFFB,	0xFFFC,	0xFFFD,	0xFFFE,	0xFFFF,	0x0000,	0x0000
.hword 	0x0001,	0x0002,	0x0002,	0x0003,	0x0003,	0x0004,	0x0004,	0x0004,	0x0004
.hword 	0x0004,	0x0004,	0x0004,	0x0004,	0x0004,	0x0003,	0x0003,	0x0003,	0x0002
.hword 	0x0002,	0x0001,	0x0001,	0x0001,	0x0000,	0x0000,	0x0000,	0x0000,	0x0000

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

		.section .ybss, bss, ymemory
		.align 2048

Bandpass250IRDelay:
		.space Bandpass250IRNumTaps*2

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

		.section .data
		.global _Bandpass250IRFilter

_Bandpass250IRFilter:
.hword Bandpass250IRNumTaps
.hword Bandpass250IRTaps
.hword Bandpass250IRTaps+Bandpass250IRNumTaps*2-1
.hword 0xff00
.hword Bandpass250IRDelay
.hword Bandpass250IRDelay+Bandpass250IRNumTaps*2-1
.hword Bandpass250IRDelay

; ..............................................................................
; ..............................................................................
; Sample assembly language calling program
;  The following declarations can be cut and pasted as needed into a program
;		.extern	_FIRFilterInit
;		.extern	_FIR
;		.extern	_Bandpass250IRFilter
;
;		.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	#_Bandpass250IRFilter, 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	#_Bandpass250IRFilter, 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
