pstrlen.asm

来自「dos 1.0 其中包含quick basic源代码、内存管理himem emm」· 汇编 代码 · 共 46 行

ASM
46
字号
;***
;* $Workfile:   pstrlen.asm  $
;* $Revision:   1.2  $
;*   $Author:   Dave Sewell  $
;*     $Date:   06 Sep 1990 14:49:40  $
;*
;*  pstrlen.asm     Alan Butt	May 12, 1988
;*
;*  String length function using pascal calling conventions
;*

%               .MODEL memmodel

        IF  @CodeSize
                .CODE   PARAGON_TEXT
        ELSE
                .CODE
        ENDIF
            
@pstrlen        PROC
                PUBLIC  @pstrlen

;   extern unsigned int _fastcall pstrlen(char near *str);
;*
;*  string length with _fastcall calling conventions
;*

                push    di
	            push    ds
	            pop     es
	            mov     di, bx

	            xor     ax, ax
	            mov     cx, -1
	            repne   scasb
	            mov     ax, cx
	            not     ax
	            dec     ax

                pop     di
	            ret

@pstrlen        ENDP

        	    END

⌨️ 快捷键说明

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