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

📄 boot_data.asm

📁 源程序是在VisualDSP环境下开发出来的
💻 ASM
字号:
#include "defTS101.h"

.global _boot_data;

#define	LINK	3

//***********************************************************************
.section data2;
.var dspd_data[] = {"Debug\\dspd.ldr"};         		// boot data
                               
//***********************************************************************

//***********************************************************************
.section program;
_boot_data:

//*************** Init Interrupt and DMA Registers **********************

	xr0 = IMASKH;;
	xr0 = bset r0 by INT_GIE_P;;					// enable global ints
	IMASKH = xr0;;

	j0 = j31 + _dma_int;;							// set DMA interrupt vector
	xr3 = TCB_DISABLE;;								// clear DMA (in case it is active)
	xr1 = IMASKL;;
	xr2 = LCTL_LREN | LCTL_PSIZE | LCTL_LTEN | LCTL_DIV8;;

#if	LINK==0
		IVDMA4 = j0;;		
		DC4 = xr3:0;;						
		xr0 = LSTATC0;;								// clear all status bits
		xr0 = bset r0 by INT_DMA4_P;;				// enable DMA4 = LINK0 TX int
		LCTL0 = XR2;;								// Link 0 transmit - DMA4
#endif

#if	LINK==1
		IVDMA5 = j0;;		
		DC5 = xr3:0;;						
		xr0 = LSTATC1;;								// clear all status bits
		xr0 = bset r0 by INT_DMA5_P;;				// enable DMA5 = LINK1 TX int
		LCTL1 = XR2;;								// Link 1 transmit - DMA5
#endif

#if	LINK==2
		IVDMA6 = j0;;		
		DC6 = xr3:0;;						
		xr0 = LSTATC2;;								// clear all status bits
		xr0 = bset r0 by INT_DMA6_P;;				// enable DMA6 = LINK2 TX int
		LCTL2 = XR2;;								// Link 2 transmit - DMA6
#endif

#if	LINK==3
		IVDMA7 = j0;;		
		DC7 = xr3:0;;						
		xr0 = LSTATC3;;								// clear all status bits
		xr0 = bset r0 by INT_DMA7_P;;				// enable DMA7 = LINK3 TX int
		LCTL3 = XR2;;								// Link 3 transmit - DMA7
#endif

	IMASKL = xr1;;

//**************** Delay for the receiver to get ready *******************

	LC1 = 100000;;

_wait_loop1:
		nop;;
		if NLC1E, jump _wait_loop1 (NP);;

//*************************** Setup the DMA ******************************

	xr0 = dspd_data;;								// xr0 = source index
	xr1 = 0x0004;;									// modify = 4
	xr3 = TCB_INTMEM | TCB_QUAD | TCB_INT | TCB_DMAR;;
	xr4 = LENGTH(dspd_data)+3;;						// round up num of words in the LDR file to nearest x4, so add 3...
	xr4 = lshift r4 by -2;;							// ...and get rid of the last two bits
	xr4 = lshift r4 by 18;;							// shift up into the count
	xr1 = r1 or r4;;

#if	LINK==0
		DC4 = xr3:0;;								// start transmit DMA
#endif

#if	LINK==1
		DC5 = xr3:0;;								// start transmit DMA
#endif

#if	LINK==2
		DC6 = xr3:0;;								// start transmit DMA
#endif

#if	LINK==3
		DC7 = xr3:0;;								// start transmit DMA
#endif

	idle;;											// stay in IDLE until done				

_end:	nop;nop;nop;nop;;
	CJMP(ABS)(NP);;

//***************************** Link DMA ISR ***********************************
.align_code 4;
_dma_int:
	nop;;											// need NOP because RTI can not be first in an ISR
	rti (ABS)(NP);;

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

	nop;;
	nop;;
	nop;;
	nop;;
	nop;;
	nop;;
	nop;;

⌨️ 快捷键说明

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