home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / C-ASM_VI.ARJ / PROGASM.ZIP / PROG026.ASM < prev    next >
Assembly Source File  |  1988-05-15  |  2KB  |  41 lines

  1.  
  2. ;************************************************************************
  3. ; Using BIOS to determine display type, and save type in AX             *
  4. ; Exit: AX - Display type                                               *
  5. ;       0 => None                                                       *
  6. ;       3 => Enhanced Display (or Multi-scan)                           *
  7. ;       4 => Color Display                                              *
  8. ;       5 => Monochrome Display                                         *
  9. ;       7 => VGA Monochrome                                             *
  10. ;       8 => VGA Color (or Multi-scan)                                  *
  11. ;************************************************************************
  12.  
  13.         PUBLIC  _BIOS_Get_Display
  14.  
  15. _BIOS_Get_Display PROC    NEAR
  16.         MOV     AX,1A00H                ;First look for VGA by trying fn=1A
  17.         INT     10H
  18.         CMP     AL,1AH                  ;There is no VGA if AL not 1A
  19.         JNE     VGA_Not_In              ;...so go look for EGA
  20.         MOV     AL,BL                   ;Return primary display info
  21.         JMP     Type_Found
  22.  
  23. VGA_Not_In:
  24.         MOV     AH,12H                  ;Select function 12hex
  25.         MOV     BL,10H                  ;       subfunction 10hex
  26.         INT     10H                     ;Call BIOS to get display type
  27.         MOV     AL,5                    ;Assume that mono is attached
  28.         OR      BH,BH                   ;Was display mono (BH = 1)?
  29.         JNZ     Type_Found              ;...Yes, we are done
  30.                                         ;...No, must look at switches
  31.         MOV     AL,3                    ;Assume Enhanced display
  32.         CMP     CL,9H                   ;Is switch 'off on on off'?
  33.         JE      Type_Found              ;...Yes, we are done
  34.         CMP     CL,3                    ;Is switch 'off off on on'?
  35.         JE      Type_Found              ;...Yes, we are done
  36.         MOV     AL,4                    ;...No, must be color display
  37. Type_Found:
  38.         XOR     AH,AH                   ;Clear AH
  39.         RET
  40. _BIOS_Get_Display ENDP
  41.