include	clib.inc
include	string.inc

_TEXT	SEGMENT

strncpy proc dist pascal public uses ds si di s1:dword, s2:dword, count:word
	lds si,s2
	les di,s1
	xor ax,ax
	mov cx,count
	cld
      @@:
	movsb
	dec cx
	jz @F
	cmp [si-1],al
	jne @B
      @@:
	mov es:[di],al
	mov ax,word ptr s1
	mov dx,word ptr s1+2
	ret
strncpy endp

_TEXT	ENDS

	END
