main.asm

来自「SUNPLUS的8BIT的MCU SPMC65X基本功能函数库及使用说明」· 汇编 代码 · 共 110 行

ASM
110
字号
;==================================================================================
; 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-8-30
;	Description		:	This program presents an example how to use the instruction
;						"jmp   *+ x".
;						
;	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	                                                    *
;*																					*
;************************************************************************************
V_Reset:
		sei								;Disable interrupt
		ldx		#C_STACK_BOTTOM			;Initial stack pointer at $01FF
		txs								;Transfer to stack pointer
		cli								;Enable interrupt
?L_Main_Loop:							;the example for test   
		;=========================================================
		;the instruction "jmp   *+6" means the process jump to
		;the address:an address location where the instruction 
		;"jmp   *+6" is held adds "6". 
		;=========================================================
		jmp  *+6		;3 bytes \
		nop				;1 bytes + = 6 bytes
		nop				;1 bytes + 
		nop				;1 bytes /
		
		;=========================================================
		;the instruction "jmp   ?L1+4" means the process jump to
		;the address:an address location where the label "?L1"
		;is held adds "4". 
		;=========================================================
		jmp  ?L1+4		;3 bytes 
		nop				;1 bytes
		nop				;1 bytes
?L1:		
		nop				;1 bytes
		nop				;1 bytes
		nop				;1 bytes
		nop				;1 bytes
?L2:		
		nop				;1 bytes
		jmp		?L_Main_Loop
;**********************************************************************************
;*                                                                                *
;*      Interrupt Vector Table                                                    *
;*                                                                                *
;**********************************************************************************
V_IRQ:      
		
		rti							
V_NMI:
        rti
        
VECTOR		.SECTION        
;*********************************************************************************
        DW      V_NMI             ; may download program emulated either
        DW      V_Reset           ; in internal memory or external memory
        DW      V_IRQ             ; dw define two bytes interrupt vector
;**********************************************************************************
;*                                                                                *
;*      End of Interrupt Vector Table                                             *
;*                                                                                *
;**********************************************************************************
.END

⌨️ 快捷键说明

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