home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 024 / psi110g.zip / VIDEO.ASM < prev    next >
Assembly Source File  |  1993-09-16  |  1KB  |  45 lines

  1. ;                .MODEL  LARGE,C
  2. include asmglobal.h                
  3.                 .CODE
  4.  
  5.                 public gettype
  6. ;
  7. ; int gettype( int * );
  8. ; returns the adapter type (1=VGA, 0=other) and number of displayed rows
  9. ;
  10.  
  11. gettype         PROC    USES SI DI, rows:PTR
  12.  
  13.                 mov     ax,40h
  14.                 mov     es,ax                   ; ES -> video BIOS data area
  15.                 mov     al,es:[84h]             ; ROWS
  16.                 xor     ah,ah
  17.                 inc     ax
  18.                 mov     bx,rows
  19.                 mov     [bx],ax                 ; number of displayed rows
  20.  
  21. ; the following function is supported only by the VGA
  22.                 mov     ax,1200h
  23.                 mov     bl,36h
  24.                 int     10h                     ; enable screen refresh
  25.                 cmp     al,12h
  26.                 xor     ax,ax                   ; assume not VGA
  27.                 jne     return                  ; jump if not supported
  28.  
  29.                 mov     ax,500h
  30.                 int     10h                     ; select display page 0
  31.  
  32. ; Select the alternate print-screen routine that works properly if the number
  33. ; of displayed rows is not 25.
  34.                 mov     ah,12h
  35.                 mov     bl,20h
  36.                 int     10h                     ; select alternate print-screen
  37.  
  38.                 mov     ax,1                    ; is VGA
  39.  
  40. return:         ret
  41.  
  42. gettype         ENDP
  43.  
  44.                 END
  45.