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

📄 init_code_bf533.asm

📁 This directory contains an example ADSP-BF533 subroutine that demonstrates how to create a loader
💻 ASM
字号:
/********************************************************************/
/*  This file contains 3 sections:									*/
/*																	*/
/*	1) A Pre-Init Section - this section saves off all the			*/
/*		registers of the DSP.										*/
/*																	*/
/*	2) A Init Code Section - this section is the customer			*/
/*		initialization code which can be modified by the customer.	*/
/*		As an example, an SDRAM initialization code is supplied.	*/
/*																	*/
/*	3) A Post-Init Section - this section restores all the			*/
/*		register from the stack.									*/
/*																	*/
/*	Customers should not modify the Pre-Init and Post-Init Sections.*/
/*	The Init Code Section can be modified for application use.		*/
/********************************************************************/

#include <defBF533.h>

.section program;

/*******Pre-Init Section*********************************************/
	[--SP] = ASTAT;		//save registers onto stack 
	[--SP] = RETS;
	[--SP] = (R7:0);
	[--SP] = (P5:0);
/******************************/

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

/*******Init Code Section********************************************/

/**Please insert Initialization code in this section************/

/*******SDRAM Setup************/
Setup_SDRAM:
	P0.L = EBIU_SDRRC & 0xFFFF;
	P0.H = (EBIU_SDRRC >> 16) & 0xFFFF;		//SDRAM Refresh Rate Control Register
	R0 = 0x074A(Z);					
	W[P0] = R0;							
	SSYNC;	

	P0.L = EBIU_SDBCTL & 0xFFFF;			
	P0.H = (EBIU_SDBCTL >> 16) & 0xFFFF;	//SDRAM Memory Bank Control Register
	R0 = 0x0001(Z);
	W[P0] = R0;
	SSYNC;		

	P0.L = EBIU_SDGCTL & 0xFFFF;			
	P0.H = (EBIU_SDGCTL >> 16) & 0xFFFF;	//SDRAM Memory Global Control Register
	R0.L = 0x998D;
	R0.H = 0x0091;
	[P0] = R0;
	SSYNC;	
/******************************/

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

/*******Post-Init Section********************************************/
/******************************/

DONE:
	(P5:0) = [SP++];  	// Restore Regs
	(R7:0) = [SP++];
	RETS = [SP++];
	ASTAT = [SP++];

	RTS;

⌨️ 快捷键说明

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