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

PPROC	rcwrite, rc:dword, wc:dword
local	lsize:	word
	push	ds
	push	si
	push	di
  ifdef __MOUSE__
	call	mousehide
  endif
	mov	ah,0
	mov	al,_scrcol
	add	ax,ax
	mov	lsize,ax
	mov	bx,word ptr rc
	call	@rcsprc
	mov	es,dx
	mov	dx,ax
	lds	si,wc
	mov	bx,si
	xor	ax,ax
	mov	cx,ax
	mov	al,rc.rc_col
	mov	ah,rc.rc_row
	cld
    rcwrite_loop:
	mov	di,dx
	add	dx,lsize
	mov	cl,al
	rep	movsw
	dec	ah
	jnz	rcwrite_loop
  ifdef __MOUSE__
	call	mouseshow
  endif
	mov	dx,ds
	mov	ax,bx
	pop	di
	pop	si
	pop	ds
	ret
PEND	rcwrite

	END
