	.386
	.model use32 small
	public _memmove
	.code
_memmove:
	push	ebp
	mov	ebp,esp
	push	esi
	push	edi
	mov	ecx,[ebp+16]
	mov	esi,[ebp+12]
	mov	edi,[ebp+8]
	mov	eax,edi
	cmp	edi,esi	
	ja	short negmove
	cld
	rep movsb
exit:
	pop	edi
	pop	esi
	pop	ebp
	ret
negmove:
	add	esi,ecx
	add	edi,ecx
	dec	esi
	dec	edi
	std
	rep	movsb
	cld
	jmp	short exit
	end