home *** CD-ROM | disk | FTP | other *** search
- include asm.inc
-
- public strcpy_limit
-
- .code
-
- ;; strcpy limit
- ;
- ; entry DS:SI source pointer
- ; ES:DI destination pointer
- ; DX destination limit
- ; exit DI updated to last character in destination
- ; uses AX
- ;
- strcpy_limit proc
- push si
- scl1: cmp di,dx
- jae scl2 ; if at destination limit
-
- lodsb ; else copy one character
- stosb
- cmp al,0
- jne scl1
-
- dec di
- scl2: pop si
- ret
- strcpy_limit endp
-
- end
-