home *** CD-ROM | disk | FTP | other *** search
- include compiler.inc
- ttl STRCAT, 1.04, 08-30-86, clr
-
- ;string function - catenates 2nd string on end of 1st
- ; - catenates 2nd string on end of 1st with max characters
- dseg
-
- cseg
-
- procdef strncat, <<dest, ptr>, <src, ptr>, <cnt, word>>
- mov cx,cnt
- jmp short start
-
- entrdef strcat
- mov cx,7fffh
-
- start:
- pushreg
- pushds
-
- push cx
- ldptr di,dest
- xor al,al
- mov cx,7fffh
- cld
- repnz scasb
- dec di
- ldptr si,src
- pop cx
- lp:
- lodsb
- stosb
- or al,al
- jz ex
-
- loop lp
- xor al,al
- stosb
- ;
- ex:
- clc
- retptrm dest
-
- pend strncat
-
- finish
-