include	clib.inc
include	conio.inc

PPROC	dlscreen, dobj:dword, attrib:word
	les	bx,dobj
	xor	ax,ax
	mov	es:[bx],ax
	mov	es:[bx+2],ax
	mov     es:[bx+4],ax	; x,y
	mov	dx,ax
	mov	al,_scrcol	; adapt to current screen
	mov	ah,_scrrow
	inc	ah
	mov	es:[bx+6],ax
	invoke	rcopen,ax::dx,_D_CLEAR or _D_BACKG,attrib,0,0
	les	bx,dobj
	stom	es:[bx.dl_wp]
	jz	@F
	mov	es:[bx.dl_flag],_D_DOPEN
	mov	dx,es
	mov	ax,bx
      @@:
	ret
PEND	dlscreen

	END
