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

📄 systemtimerisrprolog.s

📁 zilog的实时操作系统RZK,可以移植到多种处理器上
💻 S
字号:
;/*
;* File				:	SystemTimerISRProlog
;*
;* Description		:	Defines RZK's prolog.
;* 
;* Copyright 2004 ZiLOG Inc.  ALL RIGHTS RESERVED.
;*
;* This file contains unpublished confidential and proprietary information
;* of ZiLOG, Inc.
;* NO PART OF THIS WORK MAY BE DUPLICATED, STORED, PUBLISHED OR DISCLOSED 
;* IN ANY FORM WITHOUT THE PRIOR WRITTEN CONSENT OF ZiLOG, INC.
;* This is not a license and no use of any kind of this work is authorized
;* in the absence of a written license granted by ZiLOG, Inc. in ZiLOG's 
;* sole discretion 
;*/
;	.sect	".isr"	;Added 24-07-02
	.extern _RZKSystemTimerISR	
	.extern _RZKISRProlog
	.extern _RZKISREpilog
	.extern _hSysIsrThread
	.extern _hCurrentThread
	.extern _cIer
	.extern _cIir
	.extern _cCtl
	.extern _hRRThread
	.extern _RZKResumeInterruptThread
	.assume	adl=1

;/* Function		:	_SystemTimerISRProlog
;*
;* Description		:	This function will increment the uNestedISRCount and 
;						save the address of the common Epilog function and 
;						call the timer ISR C code. 
;* 
;* Inputs			:	None.
;*							
;* Outputs			:	None.
;*							
;*
;* Dependencies		:	None.
;*/
	.def _SystemTimerISRProlog
_SystemTimerISRProlog:
	PUSH	AF
	PUSH 	BC

.if _EZ80F91
    LD BC,0
    LD A, (_cIir)
    LD C, A
	IN A, (BC)

	; Disable Timer0's interrupt
	LD BC,0
	LD A, (_cIer)
	LD C,A
	IN A,(BC)
	RES 0, A
	OUT (BC), A
.else
	LD BC,0
	LD A, (_cCtl)
	LD C,A
	IN A,(BC)
	RES 6, A
	OUT (BC), A
.endif
	PUSH	DE
	PUSH	HL		; scratch reg for function call from isr
	PUSH	IX
	PUSH	IY

	LD IY, (_hCurrentThread); As the current logic does ISR execution inside a thread current thread's 
	LD (_hRRThread), IY		; context is not known inside ISR code. So store interrupted thread's handle is 
							; in hRRThread (useful in RR scenarios)

	CALL	_RZKISRProlog
	LD HL,	(_hSysIsrThread)
	PUSH	HL
	CALL	_RZKResumeInterruptThread	;Interrupt specific C code
	POP		HL

	CALL	_RZKISREpilog
	POP		IY
	POP     IX
	POP		HL
	POP		DE
 	POP		BC
	POP		AF
	EI
	RET	

⌨️ 快捷键说明

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