⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 block_fir_test.asm

📁 AD公司adsp2116x的fir程序
💻 ASM
字号:
/**************************************************************

File Name:		Block_FIR_test.asm
		
Date Modified:	01/05/99	RFG
				05/01/00	RFG

Description:	Program to call Block_FIR.asm

**************************************************************/

#include    "def21160.h"				/* Symbol Definition File */

#define     TAPS    64					/* length of filter */
#define     N       128					/* number of samples */

.extern	fir;

/* DM data */
.section/dm seg_dmda;					/* Segments are declared in the .ldf file*/
.ALIGN 2;								/* Set alignment to long-word boundary for next variable */
.var    dline[TAPS+1];					/* delay line compensate for circ buffer, see comments in block_fir.asm */
.ALIGN 2;
.var    input1[N] = "indata1.dat";		/* array of samples */
.ALIGN 2;
.var    input2[N] = "indata2.dat";		/* array of samples */


/* PM data */
.section/dm seg_pmda;
.ALIGN 2;
.var    coeffs[TAPS] = "coeffs.dat";	/* Filter coefficients */
.ALIGN 2;
.var    output1[N+2];				    /* Output array 1.  The first and last entries are dummy */
									    /* entries to allow an optimization in the fir.*/
.ALIGN 2;
.var    output2[N+2];				    /* Output array 2.  The first and last entries are dummy */
									    /* entries to allow an optimization in the fir.*/

/* PM interrupt vector code */
.section/pm   seg_rth;
Reserved_1:     rti; nop; nop; nop;
Chip_Reset:     idle; jump start; nop; nop;


/* program memory code */
.section/pm seg_pmco;

start:

/*--------------------- Setup modify registers for arrays --------------------*/
	m0 = 0;
	m1 = 1;
	m2 = -1;
	m3 = 2;

  	m9 = 2;
	m10= 1;
/*----------------------------------------------------------------------------*/



/*--------------------- Initialization delay line ----------------------------*/
	b0 = dline;
	l0 = @dline-1;

	f8=0.0;
	lcntr = TAPS, do clear_fir until lce;
clear_fir:  dm(i0,m1) = f8;

	i0 = dline;
/*----------------------------------------------------------------------------*/



/*------------------------- Setup DAGs for coeffs ----------------------------*/
	b8 = coeffs;
	l8 = @coeffs;
/*----------------------------------------------------------------------------*/
	
	
	
/*-------------- Setup DAGs for input/output and call Block_fir --------------*/
	b1 = input1;
	l1 = 0;

	b9 = output1;
	l9 = 0;

	call block_fir (db);
	r2 = N;
	r1 = TAPS;
/*----------------------------------------------------------------------------*/
	  


/*-------------- Setup DAGs for input/output and call block_fir --------------*/
	b1 = input2;
	l1 = 0;

	b9 = output2;
	l9 = 0;
	  
	call block_fir (db);
	r2 = N;
	r1 = TAPS;
/*----------------------------------------------------------------------------*/



/* Terminate and wait */
wait1:	idle;
		jump wait1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -