|
|
Microsoft OS/2 SDK 03-01-1988
; This is the same as the C runtime version of strlen, except that it takes
; a far pointer to the string. It returns the length of the string.
.MODEL SMALL
.CODE
PUBLIC _Dstrlen
_Dstrlen PROC FAR
push bp
mov bp,sp
push di
push es
mov es,[bp+8] ; str selector
mov di,[bp+6] ; str offset
xor ax,ax ; null byte
mov cx,-1
repne scasb ; scan for null, CX = -(1 + strlen(str))
not cx
dec cx
xchg ax,cx ; AX = strlen(str)
pop es
pop di
pop bp
ret
_Dstrlen ENDP
END
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.