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 >
Assembly Source File  |  1988-12-08  |  3KB  |  73 lines

  1. PAGE ,132
  2. ;GOPT.ASM
  3. ;UPDATE HISTORY
  4. ;==============
  5. ; 15 nov 1984       Convert to CI86 V2.2
  6.  
  7.     include    asmc.h
  8.     SEGEND    CODE
  9.  
  10.     SEGDEF    DATA
  11.     EXTRN    swisg:BYTE, sw100a:BYTE, gintvect:WORD
  12.     SEGEND    DATA
  13.  
  14.     SEGDEF    CODE
  15.  
  16. PUBLIC  gropt
  17.  
  18. ;********************************************************************
  19. ;                                                                   *
  20. ;       p r o c e d u r e   gropt()                                *
  21. ;                                                                   *
  22. ;       purpose:        test if Graphics Option is present.         *
  23. ;       entry:          none.                                       *
  24. ;       exit:           ax = 0          option present.             *
  25. ;                       dax = -1        option not present.         *
  26. ;       register usage: ax                                          *
  27. ;       the following globals are set:-                             *
  28. ;           swisg      1 = graphics option present                 *
  29. ;                       0 = no                                      *
  30. ;           sw100a     1 = this is Rainbow model 100a              *
  31. ;                       0 = no, 100b                                *
  32. ;           gintvect   = appropriate hardware interrupt vector     *
  33. ;********************************************************************
  34.  
  35.     PROCDEF    gropt
  36.     mov    byte ptr swisg,0    ;flag graphics board not present
  37.         in      al,8            ;input from port 8
  38.         test    al,04h          ;test bit 2 to see if option present
  39.         jz      opt1            ;if option is present, continue
  40.         mov     ax,-1           ;else, set AX for option not present
  41.         jmp     optx        ;& exit
  42. ;===============
  43. ;option present
  44. ;===============
  45. opt1:    mov    byte ptr swisg,1    ;flag graphics board present
  46. ;
  47. ;Find out what the interupt vector is for the graphics option & set gintvect.
  48. ; For a Model 100-A, the graphics interrupt vector is 22 Hexadecimal.
  49. ; For a Model 100-B, the interrupt vector is relocated up to A2H.
  50. ; If EE00:0F44h and 04<>0, we have the relocated vectors of a Model 100-B
  51. ;  and need to OR the msb of our vector.
  52. ;
  53.         push    es              ;save valid es
  54.         mov     ax,0ee00h       ;test if vectors are relocated
  55.         mov     es,ax
  56.         mov     ax,88h               ;100-A int. vector base addr
  57.     mov     byte ptr sw100a,0    ; & set provisional flag
  58.         test    es:byte ptr 0f44h,4  ;relocated vectors?
  59.         jz      g0                   ;jump if yes
  60.         mov     ax,288h              ;100-B int. vector base addr
  61.     mov     byte ptr sw100a,1    ; & reset 100b flag
  62. g0:     mov     word ptr gintvect,ax
  63.         pop     es
  64.         xor     ax,ax           ;set AX for option present
  65.  
  66. optx:   ret
  67.  
  68.     PROCEND    gropt
  69.  
  70.     include    epilogue.h
  71.         END
  72. 
  73.