dos_compilers/Manx Aztec C86 v52a/LIB/STRING/STRLEN.ASM

24 lines
358 B
NASM
Raw Normal View History

2024-07-02 17:25:54 +02:00
; :ts=8
;Copyright (C) 1983 by Manx Software Systems
include lmacros.h
procdef strlen,<<str1,ptr>>
cld
push di
ifndef LONGPTR
mov di,ds
mov es,di
endif
ldptr di,str1
mov bx,di ;save for later
sub ax,ax
mov cx,7fffH
repne scasb
mov ax,di
sub ax,bx ;compute length of string
dec ax
pop di
pret
pend strlen
finish
end