include	clib.inc

_TEXT	SEGMENT

memcpy proc dist pascal public uses ds si di s1:dword, s2:dword, count:word
	les di,s1
	lds si,s2
	mov cx,count
	mov ax,di
	mov dx,word ptr s1+2
	cld
	shr cx,1
	rep movsw
	jc memcpy_c
    memcpy_end:
	ret
    memcpy_c:
	movsb
	jmp memcpy_end
memcpy endp

_TEXT	ENDS

	END