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

PPROC	rcxchg, rc:dword, wc:dword
local	lsize:	word
	push	ds
	push	si
	push	di
	mov	ah,0
	mov	al,_scrcol
	add	ax,ax
	mov	lsize,ax
	mov	bx,word ptr rc
	call	@getxyp
	mov	dx,bx
	mov	bx,word ptr [rc+2]
	lds	si,wc
	mov	ch,0
	cld
    rcxchg_loopl:
	mov	di,dx
	add	dx,lsize
	mov	cl,bl
    rcxchg_loopc:
	mov	ax,es:[di]
	xchg	ax,[si]
	mov	es:[di],ax
	add	di,2
	add	si,2
	dec	cx
	jnz	rcxchg_loopc
	dec	bh
	jnz	rcxchg_loopl
  ifdef __MOUSE__
	call	mouseshow
  endif
	pop	di
	pop	si
	pop	ds
	ret
PEND	rcxchg

	END