lnstr.asm

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

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


;------------------------------------------------------------------------------
;
;Work out length of a string.
;
;On Entry:
;
;ESI	- pointer to string.
;
;On Exit:
;
;EAX	- length of string.
;
;ALL other registers preserved.
;
LenString	proc	near
	pushm	edi,ecx
	mov	edi,esi
	or	ecx,-1
	xor	al,al
	repnz	scasb		;get the strings length.
	mov	eax,ecx
	not	eax
	dec	eax		;Don't include terminator.
	popm	edi,ecx
	ret
LenString	endp


	efile
	end

⌨️ 快捷键说明

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