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

📄 string_copy.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.
;==================================================================================
																					
;==================================================================================
;  Program Name		:	string_copy.asm
;  Description		:	This program  copy a string to another string.		 
;  Reference		:	SPMC65P2404A/2408A Data Sheet
;  Revision history	:
;---------------------------------------------------------------------------------- 
;  Version		Date 		Description
;  1.0.0    	2004-8-11	First Edition
;==================================================================================

.SYNTAX  6502							;process standard 6502 addressing syntax
.LINKLIST								;generate linklist information
.SYMBOLS								;generate symbolic debug information
;************************************************************************************
C_LIB_DEF		EQU		1
.INCLUDE		AN_O0100.INC		;Define	external variable
;**********************************************************************************
.PAGE0					
.DATA									;define data storage section
;**********************************************************************************
.CODE
;==================================================================================
;	Function:		F_Stringcopy
;	Description:	transfers the contents of an N-byte RAM area String1 indicated by
;					[GB_String1_Adr] to another N-byte RAM area String2 indicated by 
;					[GB_String2_Adr].       
;	Input:			y(0 String1->string2,not 1 String2->string1)
;	Output:			A(error ,a is'not zero)
;	Destroy:		A,X
;	Stacks:			1
;==================================================================================
.PUBLIC		F_Stringcopy
F_Stringcopy:
		ldy		#0
?L_Stringcopy_Loop:		
		lda		(GB_String_Addr1),y		;get data from block1
		sta		(GB_String_Addr2),y		;transfer data to block2		
		beq		?_Stringcopy_End		;transfer end ? yes
		iny								;index regist add 1
		jmp		?L_Stringcopy_Loop		
?_Stringcopy_End:
		rts
	

⌨️ 快捷键说明

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