Category : Assembly Language Source Code
Archive   : JED.ZIP
Filename : DISPID.SRC

 
Output of file : DISPID.SRC contained in archive : JED.ZIP
;---------------------------------------------------------------
; DispID -- Identifies the installed display adapter
; Last update 3/8/89
;
; 1 entry point:
;
; DispID:
; Caller passes no parameters
; Routine returns a code value in AX.
; The codes are these:
; 0 : Adapter is unknown; recommend aborting
; 1 : MDA (Monochrome Display Adapter)
; 2 : CGA (Color Graphics Adapter)
;
;---------------------------------------------------------------

DispID PROC
mov AH,1AH ; Select PS/2 Identify Adapter Service
xor AL,AL ; Select Get Combination Code Subservice (AL=0)
int 10H ; Call VIDEO
cmp AL,1AH ; If AL comes back with 1AH, we have a PS/2
jne TryEGA ; If not, jump down to test for the EGA
mov AL,BL ; Put Combination Code into AL
ret ; and go home!
TryEGA: mov AH,12H ; Select EGA Alternate Function
mov BX,10H ; Select Get Configuration Information subservice
int 10H ; Call VIDEO
cmp BX,10H ; If BX comes back unchanged, EGA is *not* there
je OldBords ; Go see whether it's an MDA or CGA
cmp BH,0 ; If BH = 0, it's an EGA/color combo
je EGAColor ; otherwise it's EGA/mono
mov AL,5 ; Store code 5 for EGA mono
ret ; and go home!
EGAColor: mov AL,4 ; Store code 4 for EGA color
ret ; and go home!
OldBords: int 11H ; Call Equipment Configuration interrupt
test AL,30H ; If bits 4 & 5 are both =1, it's an MDA
jne CGA ; otherwise it's a CGA
mov AL,1 ; Store code 1 for MDA
ret ; and go home!
CGA: mov AL,2 ; Store code 2 for CGA
ret ; and go home!
DispID ENDP

  3 Responses to “Category : Assembly Language Source Code
Archive   : JED.ZIP
Filename : DISPID.SRC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/