include	clib.inc
include	conio.inc
include	malloc.inc
include	mouse.inc

ifdef __MOUSE__

PPROC	dlmove, dobj:dword
  ifdef __WCC__
    local result:dword
  endif
	les	bx,dobj
	mov	ax,es:[bx]
	and	ax,_D_DMOVE or _D_DOPEN or _D_ONSCR
	cmp	ax,_D_DMOVE or _D_DOPEN or _D_ONSCR
	jne	dlmove_nul
	call	mousep
	jz	dlmove_nul
	les	bx,dobj
	pushm	es:[bx.dl_rect]
	pushm	es:[bx.dl_wp]
	push	es:[bx.dl_flag]
  ifdef __WCC__
	lea	ax,result
	push	ax
  endif
	call	rcmsmove
  ifdef __WCC__
	mov	ax,word ptr result
	mov	dx,word ptr result+2
  endif
	les	bx,dobj
	stom	es:[bx.dl_rect]
	mov	ax,1
    dlmove_end:
	ret
    dlmove_nul:
	xor	ax,ax
	jmp	dlmove_end
PEND	dlmove

endif

	END
