home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / ctenari / Puching / ASEMBLER / GETDISP.ASM < prev    next >
Assembly Source File  |  1998-07-10  |  1KB  |  54 lines

  1. TITLE    GetDisp
  2. ;Program zjisti typ grafickeho adapteru
  3.  
  4. Code    SEGMENT
  5.     ASSUME    cs:Code,ds:Code
  6.     ORG    100h
  7.  
  8. Start:    lea    dx,Text
  9.     call    Write
  10.     mov    bl,10h
  11.     mov    ah,12h
  12.     int    10h
  13.     cmp    bl,10h        ;neni EGA ani VGA
  14.     jnz    EGAVGA
  15.     jmp    NEGAVGA
  16. EGAVGA:    mov    ax,1a00h
  17.     int    10h
  18.     cmp    al,1ah        ;priznak MCGA nebo VGA
  19.     jnz    EGA        ;je to EGA
  20.     lea    dx,vgaTxt    ;neni EGA -> je to VGA
  21.     call    Write
  22.     mov    al,3        ;VGA navratovy kod (errorlevel)=3
  23.     jmp    Exit
  24. EGA:    lea    dx,egaTxt
  25.         call    Write
  26.     mov    al,2        ;EGA errorlevel=2
  27.     jmp    Exit
  28. NEGAVGA:xor    ax,ax
  29.     mov    es,ax
  30.     mov    al,byte ptr es:[410h]
  31.     and    al,48        ;jen bity urcujici typ diplejove karty
  32.     cmp    al,48        ;priznak MDA/Hercules
  33.     jnz    CGA        ;neni MDA ani Hercules, ale CGA
  34.     lea    dx,mdaTxt
  35.     mov    al,1        ;MDA errorlevel=1
  36.     jmp    Exit
  37. CGA:    lea    dx,cgaTxt
  38.     xor    al,al        ;CGA errorlevel=0
  39. Exit:    mov    ah,4ch        ;ukoncovaci sekvence s nastavenim errorlevelu
  40.     int    21h
  41.  
  42. Write:    mov    ah,9
  43.     int    21h
  44.     ret
  45.  
  46.     Text    DB 'GetDisp verze 1.0 - (c) 1998 René Puchinger',13,10
  47.         DB 'Grafick∞ adaptér: $'
  48.     cgaTxt    DB 'CGA$',13,10,'$'
  49.     egaTxt    DB 'EGA$',13,10,'$'
  50.     vgaTxt    DB 'VGA/MCGA$',13,10,'$'
  51.     mdaTxt    DB 'MDA/Hercules$',13,10,'$'
  52.  
  53. Code    ENDS
  54.     END    Start