strlnpx.asm

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

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


;------------------------------------------------------------------------------
;
;Work out the pixel length of a string.
;
;On Entry:
;
;ESI	- String to scan.
;EDI	- Font to use.
;
;On Exit:
;
;EAX	- Length in pixels.
;
;ALL other registers preserved.
;
StringLenPixels proc near
	pushm	ebx,ecx,esi,edi
	xor	ecx,ecx
@@1:	movzx	eax,b[esi]
	or	al,al
	jz	@@0
	inc	esi
	mov	ebx,[edi+eax*4]	;point to this character.
	add	ecx,BM_Wide[ebx]
	jmp	@@1
@@0:	mov	eax,ecx
	popm	ebx,ecx,esi,edi
	ret
StringLenPixels endp


	efile
	end

⌨️ 快捷键说明

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