home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
decus
/
RB140
/
grlib03a.arj
/
GOPT.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-12-08
|
3KB
|
73 lines
PAGE ,132
;GOPT.ASM
;UPDATE HISTORY
;==============
; 15 nov 1984 Convert to CI86 V2.2
include asmc.h
SEGEND CODE
SEGDEF DATA
EXTRN swisg:BYTE, sw100a:BYTE, gintvect:WORD
SEGEND DATA
SEGDEF CODE
PUBLIC gropt
;********************************************************************
; *
; p r o c e d u r e gropt() *
; *
; purpose: test if Graphics Option is present. *
; entry: none. *
; exit: ax = 0 option present. *
; dax = -1 option not present. *
; register usage: ax *
; the following globals are set:- *
; swisg 1 = graphics option present *
; 0 = no *
; sw100a 1 = this is Rainbow model 100a *
; 0 = no, 100b *
; gintvect = appropriate hardware interrupt vector *
;********************************************************************
PROCDEF gropt
mov byte ptr swisg,0 ;flag graphics board not present
in al,8 ;input from port 8
test al,04h ;test bit 2 to see if option present
jz opt1 ;if option is present, continue
mov ax,-1 ;else, set AX for option not present
jmp optx ;& exit
;===============
;option present
;===============
opt1: mov byte ptr swisg,1 ;flag graphics board present
;
;Find out what the interupt vector is for the graphics option & set gintvect.
; For a Model 100-A, the graphics interrupt vector is 22 Hexadecimal.
; For a Model 100-B, the interrupt vector is relocated up to A2H.
; If EE00:0F44h and 04<>0, we have the relocated vectors of a Model 100-B
; and need to OR the msb of our vector.
;
push es ;save valid es
mov ax,0ee00h ;test if vectors are relocated
mov es,ax
mov ax,88h ;100-A int. vector base addr
mov byte ptr sw100a,0 ; & set provisional flag
test es:byte ptr 0f44h,4 ;relocated vectors?
jz g0 ;jump if yes
mov ax,288h ;100-B int. vector base addr
mov byte ptr sw100a,1 ; & reset 100b flag
g0: mov word ptr gintvect,ax
pop es
xor ax,ax ;set AX for option present
optx: ret
PROCEND gropt
include epilogue.h
END