	name	oak

	.386p

INCLUDE	..\common\vgadrvr.inc

_CODE	SEGMENT DWORD PUBLIC 'CODE'

ASSUME	cs:_CODE

	org	0

smo	EQU	offset set_mode
mspo	EQU	offset set_page
cco	EQU	offset CCOPY

head	vga_header	<,11h,52h,55h,,53h,54h,59h,58h,0,0,mspo,mspl,mspo,mspl,cco,ccl>

setpage	MACRO	srcpage,dstpage	; page to be set is in ah
	IFIDN	<dstpage>,<ah>	; dst == ah
	IFIDN	<srcpage>,<ah>	; dst == ah && src == ah
	mov	al,ah
	shl	ah,4
	or	ah,al
	ELSE			; dst == ah && src != ah
	shl	ah,4
	or	ah,srcpage
	ENDIF
	ELSE			; dst != ah
	IFIDN	<srcpage>,<ah>	; dst != ah && src == ah
	IFDIF	<dstpage>,<al>	; dst != ah && src == ah && dst != al
	mov	al,dstpage
	ENDIF
	shl	al,4
	or	ah,al
	ELSE			; dst != ah && src != ah
	mov	ah,dstpage
	shl	ah,4
	or	ah,srcpage
	ENDIF
	ENDIF

	mov	al,11h		; register 0dh
	push	dx
	mov	dx,03deh
	out	dx,ax		; set the page
	pop	dx
	ENDM


include ccopy2.asm


copyright db	10, 13, 'OAK driver '
include version.asm
include date.asm
	db	'Copyright (c) 1992 Starnet Communications '
	db	'Corporation. All rights reserved.',10,13,'$'

set_page PROC NEAR
	push	edx
	mov	ah,al		; page
	shl	al,4
	or	ah,al
	mov	al,11h
	mov	dx,03deh
	out	dx,ax

;	mov	dx,ax
;	mov	ax,4f05h
;	sub	ebx,ebx
;	int	10h

	pop	edx
	ret
mspl	EQU	$ - offset set_page
set_page ENDP


_CODE	ENDS

	END
