include	clib.inc

	public	_scrseg
	public	_scrcol
	public	_scrrow
	public	_screct

_TEXT	SEGMENT

_screct	PROC	DIST
	mov	ax,0040h
	mov	es,ax
	mov	bx,0063h
	mov	ax,es:[bx]
	and	ax,0FF0h
	cmp	ax,03B0h
	jne	screct_B800
	mov	_scrseg,0B000h
    screct_B800:
	mov	bx,004Ah        ; screen columns [0040:004A]
	mov	al,es:[bx]
	mov	_scrcol,al
	mov	ah,al		; = ah
	mov	bl,84h		; screen rows minus one [0040:0084]
	mov	al,es:[bx]
	mov	_scrrow,al	; = al
	ret
_screct	ENDP

Install	PROC
	call	_screct
	ret
Install	ENDP

_TEXT	ENDS

_DATA	SEGMENT

_scrcol	DB	80
_scrrow	DB	24
_scrseg	DW	0B800h

_DATA	ENDS

_INIT_	SEGMENT
	DW	Install
_INIT_	ENDS

	END
