home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1995 March / SOFM_Mar1995.bin / pc / dtp / qpeg / install.dat / DRVSRC / CHIPSTEC.ASM < prev    next >
Assembly Source File  |  1994-07-02  |  2KB  |  101 lines

  1. ;
  2. ; QPEG video driver
  3. ; for Chips & Technologies chipsets (82c45x, F655x0)
  4. ;
  5.  
  6.         .286
  7. Code    Segment Para 'Code'
  8.         Assume  cs:Code
  9.         Org 100h
  10.  
  11. Procs   dw      Bank,Init,Exit,0
  12.  
  13. Chipset db      0
  14.         ; 0 = 82c451, 82c455, 82c456, 82c457
  15.         ; 1 = 82c452
  16.         ; 2 = 82c450, 82c453, F655x0
  17.  
  18. Bank:   push    ax
  19.         mov     dl,Chipset
  20.         test    dl,dl
  21.         jz      Bank0
  22.         dec     dl
  23.         jz      Bank1
  24.  
  25. Bank2:  mov     dx,03d6h
  26.         shl     ax,12
  27.         mov     al,10h
  28.         out     dx,ax
  29.         pop     ax
  30.         retf
  31.  
  32. Bank1:  mov     dx,03d6h
  33.         shl     ax,10
  34.         mov     al,10h
  35.         out     dx,ax
  36.         pop     ax
  37.         retf
  38.  
  39. Bank0:  mov     dx,03d6h
  40.         mov     ah,al
  41.         mov     al,0bh
  42.         out     dx,ax
  43.         pop     ax
  44.         retf
  45.  
  46. Init:   mov     dx,46e8h
  47.         mov     ax,001eh
  48.         out     dx,ax           ; enter setup mode
  49.         push    dx
  50.         mov     dx,0103h
  51.         mov     al,80h
  52.         out     dx,ax           ; enable extended registers
  53.         pop     dx
  54.         mov     al,0eh
  55.         out     dx,ax           ; leave setup mode
  56.  
  57.         mov     dx,03d6h
  58.         mov     al,04h
  59.         out     dx,al
  60.         inc     dx
  61.         in      al,dx
  62.         or      al,04h
  63.         out     dx,al           ; enable bank access & extended CRTC
  64.  
  65.         dec     dx
  66.         mov     al,0bh
  67.         out     dx,al
  68.         inc     dx
  69.         in      al,dx
  70.         and     al,0fch
  71.         or      al,01h
  72.         out     dx,al           ; enable extended paging & single page mode
  73.  
  74.         dec     dx
  75.         xor     ax,ax
  76.         out     dx,al
  77.         inc     dx
  78.         in      al,dx
  79.         shr     al,4
  80.         jz      ready   ; 82c451 -> 0
  81.         dec     al
  82.         jz      ready1  ; 82c452 -> 1
  83.         dec     al
  84.         jz      ready   ; 82c455 -> 0
  85.         cmp     al,3
  86.         jb      ready2  ; 82c453/0 -> 2
  87.         cmp     al,5
  88.         jb      ready   ; 82c456/7 -> 0
  89.                         ; F655x0 -> 2
  90. ready2: inc     ah
  91. ready1: inc     ah
  92. ready:  mov     cs:Chipset,ah
  93.         retf
  94.  
  95. Exit:   retf
  96.  
  97. Code    Ends
  98.         End Procs
  99.  
  100. ; End of source.
  101.