copystr.asm

来自「开放源码的编译器open watcom 1.6.0版的源代码」· 汇编 代码 · 共 37 行

ASM
37
字号
	include ..\cwlib.inc
	scode

;-------------------------------------------------------------------------
;
;Copy a string from one place to another.
;
;On Entry:
;
;ESI	- Source string.
;EDI	- Destination string.
;
;On Exit:
;
;ALL registers preserved.
;
CopyString	proc	near
	pushm	eax,ecx,esi,edi
	push	esi
	xchg	esi,edi
	or	ecx,-1
	xor	al,al
	repnz	scasb		;get the strings length.
	inc	ecx
	neg	ecx
	xchg	esi,edi
	pop	esi
	rep	movsb		;copy the string.
	popm	eax,ecx,esi,edi
	ret
CopyString	endp


	efile
	end

⌨️ 快捷键说明

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