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

📄 irq.asm

📁 详细介绍了凌阳8位单片机中断的使用方法. 详细介绍了凌阳8位单片机中断的使用方法.
💻 ASM
字号:
;==================================================================================
; The information contained herein is the exclusive property of
; Sunplus Technology Co. And shall not be distributed, reproduced,
; or disclosed in whole in part without prior written permission.
;       (C) COPYRIGHT 2004   SUNPLUS TECHNOLOGY CO.                                  
;                   ALL RIGHTS RESERVED
; The entire notice above must be reproduced on all authorized copies.
;==================================================================================
																					
;==================================================================================
;	Project Name	:	IRQ
;	Applied Body	:	SPMC65P2404A
;	Firmware version:
;	Programer		:
;	Date			:	2005-4-25
;	Description		:	External interrupt
;						
;	Hardware Connect:	
;	Link File		:	
;	IDE Version		: 	V1.6.5	
;	BODY Version	:	V1.0.0A
;==================================================================================

.SYNTAX  6502								;Process standard 6502 addressing syntax
.LINKLIST									;Generate linklist information
.SYMBOLS									;Generate symbolic debug information
;************************************************************************************
;*      System Register Define														
;************************************************************************************

;************************************************************************************
.INCLUDE		SPMC65P2404A.inc			;Define all hardware,Registers and ports.		
;************************************************************************************
;************************************************************************************
;*      Data memory Define	                                                        
;************************************************************************************
.PAGE0								;Define values in the range from 00h to FFh
;************************************************************************************
.DATA								;Define data storage section  
;************************************************************************************          
;************************************************************************************
;*      Program Area															
;************************************************************************************
.CODE              
;************************************************************************************
;*      Power on Reset Process	                                                    
;************************************************************************************
;====================================================================================
;	Function Name:	V_Reset
;	Description:	External interrupt description
;	Input:			none
;	Output:         none
;	Destroy:		A
;====================================================================================
.PUBLIC		V_Reset
V_Reset:
		sei									; Disable interrupt
		ldx		#C_STACK_BOTTOM				; Initial stack pointer at $00FF
		txs									; Transfer to stack point  				
F_Main:
		lda		#$FF
		sta		P_IOA_Dir
		lda		#$00
		sta		P_IOA_Attrib
		sta		P_IOA_Data
		
		lda		P_IOD_Buf
		and		#%11111101	
		sta		P_IOD_Data    
		lda		P_IOD_Attrib
		and		#%11111101
		sta		P_IOD_Attrib		
		lda		P_IOD_Dir              
		and		#%11111101				
		sta		P_IOD_Dir					; PortD 1  as input low
		lda		#%00001000        
		sta		P_INT_Ctrl0             	; IRQ3 INT enable bit   	
		lda		#%00000000	            
		sta		P_IRQ_Opt1                  ; Falling edge trigger
		sta		P_IRQ_Opt1         
		lda		#%00001000
		sta		P_INT_Flag0					; clear IRQ3 INT flag bit   
		cli
 L_Loop:
		nop
		jmp		L_Loop			

;************************************************************************************
;*      Interrupt Service Process                 
;************************************************************************************
V_IRQ:
		pha
		txa
		pha        
;-------------------------------
;IRQ3 INT service process
;-------------------------------
		lda		P_INT_Flag0
		and		#%00001000                  ; IRQ3 INT ?
		beq		V_IRQ_Exit		            ; no   			
		nop						      		; user information
		lda		#%00001000
		sta		P_INT_Flag0		      		; clear IRQ0 INT flag bit
		lda		#$FF
		sta		P_IOA_Data
V_IRQ_Exit:
		pla
		tax
		pla
		rti          
V_NMI:
		rti
;************************************************************************************
;*      Interrupt Vector Table
;************************************************************************************	
VECTOR		.SECTION
		DW		V_NMI						; Non-mask interrupt vector
		DW		V_Reset						; Reset vector
		DW		V_IRQ						; IRQ interrupt vector
;************************************************************************************
;*      End of Interrupt Vector Table	
;************************************************************************************
.END

⌨️ 快捷键说明

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