
PAGE  59,132

;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл
;лл								         лл
;лл			        GLUK				         лл
;лл								         лл
;лл      Created:   15-Dec-90					         лл
;лл      Passes:    9	       Analysis Options on: none	         лл
;лл								         лл
;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл

.286c

data_2e		equ	141h			;*
data_3e		equ	143h			;*

seg_a		segment	byte public
		assume	cs:seg_a, ds:seg_a


		org	100h

gluk		proc	far

start:
		mov	ax,3508h
		int	21h			; DOS Services  ah=function 35h
						;  get intrpt vector al in es:bx
		mov	ds:data_2e,bx
		mov	ds:data_3e,es
		mov	dx,offset int_08h_entry
		mov	ah,25h			; '%'
		int	21h			; DOS Services  ah=function 25h
						;  set intrpt vector al to ds:dx
		mov	dl,45h			; 'E'
		int	27h			; Terminate & stay resident
						;  dx=offset last byte+1, cs=PSP
data_1		dw	100h

gluk		endp

;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл
;
;			External Entry Point
;
;лллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллллл

int_08h_entry	proc	far
		pusha				; Save all regs
		mov	al,2
		out	40h,al			; port 40h, 8253 timer 0 clock
		mov	al,3
		out	40h,al			; port 40h, 8253 timer 0 clock
		mov	dx,3DAh
		in	al,dx			; port 3DAh, CGA/EGA vid status
		mov	dl,0C0h
		mov	al,33h			; '3'
		out	dx,al			; port 3C0h, EGA attributes
		mov	ax,cs:data_1
		out	dx,al			; port 3C0h, EGA attributes
		add	al,ah
		test	al,8
		jz	loc_3			; Jump if zero
		not	ah
		add	al,ah
loc_3:
		mov	cs:data_1,ax
		popa				; Restore all regs
;*		jmp	far ptr loc_2		;*
		db	0EAh, 00h, 00h, 79h, 81h
int_08h_entry	endp


seg_a		ends



		end	start
