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

📄 main.asm

📁 SUNPLUS的8BIT的MCU SPMC65X基本功能函数库及使用说明
💻 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	:	
;	Applied Body	:	SPMC65P2404A
;	Firmware version:
;	Programer		:
;	Date			:	2004-9-11
;	Description		:	The program presents an example that how to use MACRO.
;						
;	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
.INCLUDE	  Macro.asm					;an example of addition in the form of macro     
;************************************************************************************

;************************************************************************************
;*																					*
;*      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	                                                    *
;*																					*
;************************************************************************************
V_Reset:
		sei								;Disable interrupt
		ldx		#C_STACK_BOTTOM			;Initial stack pointer at $00ff
		txs								;Transfer to stack point
        
?L_Main_Loop:							;the example for test

;==============================================
;Instruction:	M_BitClr	$82,x
;Function:		Clear Bit x of the data in $82
;Example:		M_BitClr	$82,1 
		        ;clear bit1 of the data in $82			
;==============================================
		M_BitClr	$82,0				;clear bit0 of the data in $82 			
		M_BitClr	$82,1				;clear bit1 of the data in $82           
		M_BitClr	$82,2				;clear bit2 of the data in $82           
		M_BitClr	$82,3				;clear bit3 of the data in $82           
		M_BitClr	$82,4				;clear bit4 of the data in $82           
		M_BitClr	$82,5				;clear bit5 of the data in $82           
		M_BitClr	$82,6				;clear bit6 of the data in $82           
		M_BitClr	$82,7				;clear bit7 of the data in $82           
                                                                                                         
;==============================================                                                          
;Instruction:	M_BitSet	$82,x                                                                    
;Function:		Set Bit x of the data in $82                                                     
;Example:		M_BitSet	$82,1                                                            
		        ;set bit1 of the data in $82			                                 
;==============================================                                                          
		M_BitSet	$82,0				;set bit0 of the data in $82             
		M_BitSet	$82,1				;set bit1 of the data in $82             
		M_BitSet	$82,2				;set bit2 of the data in $82             
		M_BitSet	$82,3				;set bit3 of the data in $82             
		M_BitSet	$82,4				;set bit4 of the data in $82             
		M_BitSet	$82,5				;set bit5 of the data in $82             
		M_BitSet	$82,6				;set bit6 of the data in $82             
		M_BitSet	$82,7				;set bit7 of the data in $82             
                                                                                                         
;==============================================                                                          
;Instruction:	M_BitInv	$82,x                                                                    
;Function:		Inverse Bit x of the data in $82                                                 
;Example:		M_BitInv	$82,1                                                            
		        ;Inverse bit1 the of data in $82			                         
;==============================================                          
		M_BitInv	$82,0				;inverse bit0 the of data in $82      
		M_BitInv	$82,1				;inverse bit2 the of data in $82         
		M_BitInv	$82,2				;inverse bit3 the of data in $82         
		M_BitInv	$82,3				;inverse bit4 the of data in $82         
		M_BitInv	$82,4				;inverse bit5 the of data in $82         
		M_BitInv	$82,5				;inverse bit6 the of data in $82         
		M_BitInv	$82,6				;inverse bit7 the of data in $82         
		M_BitInv	$82,7				;inverse bit7 the of data in $82         
	                                                                                                 
;==============================================                                                          
;Instruction:	M_Bittst	$82,x                                                                    
;Function:		Test Bit x of the data in $82                                                    
;Example:		M_Bittst	$82,1                                                            
		        ;Set "Z" if bit1 of the data                                                     
		        ;in $82 is 0.			                                                 
;==============================================		                                                 
		M_Bittst	$82,0				;set "Z" if bit0 of the data in $82 is 0 
		M_Bittst	$82,1				;set "Z" if bit1 of the data in $82 is 0 
		M_Bittst	$82,2				;set "Z" if bit2 of the data in $82 is 0 
		M_Bittst	$82,3				;set "Z" if bit3 of the data in $82 is 0 
		M_Bittst	$82,4				;set "Z" if bit4 of the data in $82 is 0 
		M_Bittst	$82,5				;set "Z" if bit5 of the data in $82 is 0 
		M_Bittst	$82,6				;set "Z" if bit6 of the data in $82 is 0 
		M_Bittst	$82,7				;set "Z" if bit7 of the data in $82 is 0 

		
		jmp		?L_Main_Loop
                
;************************************************************************************
;*																					*
;*      Interrupt service process                         	                        *
;*																					*
;************************************************************************************
V_IRQ:      
		rti           
V_NMI:
		rti
		
VECTOR		.SECTION		
;************************************************************************************
;*																					*
;*      Interrupt Vector Table														*
;*																					*
;************************************************************************************
		DW		V_NMI					;Non-mask interrupt vector(no use)
		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 + -