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

📄 strcat.asm

📁 汇编编程艺术
💻 ASM
字号:
StdGrp		group	stdlib,stddata
stddata		segment	para public 'sldata'
stddata		ends
;
stdlib		segment	para public 'slcode'
		assume	cs:stdgrp
;
;
; strcat- Appends one string to the end of another.
;
; inputs:
;
;	ES:DI- Points at destination string, the one to which the source
;	       string will be appended.
;
;	DX:DI- Points at the string to append.
;
;
; Note: The destination string's (ES:DI) buffer must be sufficiently large
;	to hold the result of the concatentation of the two strings.
;
		public	sl_strcat
;
sl_strcat	proc	far
		push	ds
		push	cx
		push	ax
		pushf
		push	si
		push	di
;
		mov	ds, dx
		cld
;
; Find the end of the destination string:
;
		mov	al, 0
		mov	cx, 0ffffh
	repne	scasb
;
; Copy the second string to the end of the current string.
;
		dec	di
CpyLp:		lodsb
		stosb
		cmp	al, 0
		jnz	CpyLp
;
		pop	di
		pop	si
		popf
		pop	ax
		pop	cx
		pop	ds
		ret
sl_strcat	endp
;
;
stdlib		ends
		end

⌨️ 快捷键说明

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