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

📄 core_event.asm

📁 基于ADI 公司的blackfin芯片的通用中断框架程序
💻 ASM
字号:
.section program;


#include "..\intrmgr\intr.def"
	
	

_nmi_isr:

	.global _nmi_isr;

FOREVER:

	idle;
	
	jump.s FOREVER;
	
	rti;
	
_nmi_isr.end:



.extern _exception_handler;

.extern _g_user_exception_handler;

_exception_isr:

	.global _exception_isr;
	
	// save context
	
	BEGIN_HANDLER
	
	r0 = seqstat;
	
	r1 = 0x3f;
	
	r0 = r0 & r1;
	
	r1 = 16;
	
	cc = r0 < r1;
	
	if !cc jump EXCEPTION_UNCOVERABLE;
	
	LDREG(p0, _g_user_exception_handler);
	
	p0 = [p0];
	
	cc = p0 == 0;
	
	if cc jump EXCEPTION_HANDLER_END;
	
	call (p0);

	
EXCEPTION_HANDLER_END:
	
	END_HANDLER

	rtx;
	
	
EXCEPTION_UNCOVERABLE:
	
	r1 = retx;
	
	LDREG(p0, _exception_handler);
	
	call (p0);
	
	idle;
	
_exception_isr.end:



.extern _hardware_error_handler;

.extern _g_user_hardware_error_handler;


_hardware_error_isr:

	.global _hardware_error_isr;
	
	BEGIN_HANDLER
	
	r0 = seqstat;
	
	r1.h = 0x7;
	
	r1.l = 0xc000;
	
	r0 = r0 & r1;
	
	r1.h = 0x6;
	
	r1.l = 0;
	
	cc = r0 == r1;
	
	if !cc jump HARDWARE_ERROR_UNRECOVERABLE;
	
	LDREG(p0, _g_user_hardware_error_handler);
	
	p0 = [p0];
	
	cc = p0 == 0;
	
	if cc jump HARDWARE_ERROR_END;
	
	call (p0);
	
	
HARDWARE_ERROR_END:

	END_HANDLER
	
	rti;
	
	
HARDWARE_ERROR_UNRECOVERABLE:

	r1 = reti;
	
	LDREG(p0, _hardware_error_handler);
	
	call (p0);
	
	idle;
	
_hardware_error_isr.end:


#define TCNTL	0xffe03000


.extern _core_timer_handler;


_core_timer_isr:

	.global _core_timer_isr;
	
	BEGIN_HANDLER

		
	LDREG(p0, TCNTL);
	
	r0 = 0;
	
	[p0] = r0;		// disable core timer
	
	LDREG(p0, _core_timer_handler);
	
	call (p0);
	
	LDREG(p0, TCNTL);
	
	r0 = 7;
	
	[p0] = r0;		// enable core timer and make it active
	

	END_HANDLER
	
	rti;
	
_core_timer_isr.end:



⌨️ 快捷键说明

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