.model large,c
.code


pan	proc	far	x:word,y:word
public	pan

	mov	ax,y
	mov	cx,80
	mul	cx
	mov	cx,ax
	
	mov	bx,x
	mov	ax,bx
	and	bl,111b		;fly
	shr	ax,1
	shr	ax,1
	shr	ax,1
	add	cx,ax
	
	mov	dx,3dah
wat:
	in	al,dx
	jmp	$+2
	test	al,8
	jz	wat
wat1:
	in	al,dx
	jmp	$+2
	test	al,8
	jnz	wat1

	
	mov	dx,3d4h
	mov	al,0ch
	mov	ah,ch
	out	dx,ax
	
	inc	al
	mov	ah,cl
	out	dx,ax

	mov	dx,3dah

wat2:
	in	al,dx
	jmp	$+2
	test	al,8
	jz	wat2

	mov	dx,3c0h
	mov	al,13h
	out	dx,al
	mov	al,bl
	out	dx,al
	mov	al,0ffh
	out	dx,al	


	ret
pan	endp
end