home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 November
/
Chip_1998-11_cd.bin
/
ctenari
/
Puching
/
ASEMBLER
/
GETDISP.ASM
< prev
next >
Wrap
Assembly Source File
|
1998-07-10
|
1KB
|
54 lines
TITLE GetDisp
;Program zjisti typ grafickeho adapteru
Code SEGMENT
ASSUME cs:Code,ds:Code
ORG 100h
Start: lea dx,Text
call Write
mov bl,10h
mov ah,12h
int 10h
cmp bl,10h ;neni EGA ani VGA
jnz EGAVGA
jmp NEGAVGA
EGAVGA: mov ax,1a00h
int 10h
cmp al,1ah ;priznak MCGA nebo VGA
jnz EGA ;je to EGA
lea dx,vgaTxt ;neni EGA -> je to VGA
call Write
mov al,3 ;VGA navratovy kod (errorlevel)=3
jmp Exit
EGA: lea dx,egaTxt
call Write
mov al,2 ;EGA errorlevel=2
jmp Exit
NEGAVGA:xor ax,ax
mov es,ax
mov al,byte ptr es:[410h]
and al,48 ;jen bity urcujici typ diplejove karty
cmp al,48 ;priznak MDA/Hercules
jnz CGA ;neni MDA ani Hercules, ale CGA
lea dx,mdaTxt
mov al,1 ;MDA errorlevel=1
jmp Exit
CGA: lea dx,cgaTxt
xor al,al ;CGA errorlevel=0
Exit: mov ah,4ch ;ukoncovaci sekvence s nastavenim errorlevelu
int 21h
Write: mov ah,9
int 21h
ret
Text DB 'GetDisp verze 1.0 - (c) 1998 René Puchinger',13,10
DB 'Grafick∞ adaptér: $'
cgaTxt DB 'CGA$',13,10,'$'
egaTxt DB 'EGA$',13,10,'$'
vgaTxt DB 'VGA/MCGA$',13,10,'$'
mdaTxt DB 'MDA/Hercules$',13,10,'$'
Code ENDS
END Start