## Display Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Function FAH - Interrogate Driver

This function returns a value specifying whether the EGA.SYS device driver is present.

Input

AH = FAh

BX = 0

Output

AX: Restored
BX: 0, if EGA.SYS driver is not present
ES:BX: Pointer to EGA Register Interface version number, if present
Byte 1: Major release number
Byte 2: Minor release number (in 1/100ths)

Example

The following example interrogates the driver and displays the results:

    gotmsg  db   "EGA.SYS driver found", 0dh, 0ah, 24h
    nopmsg  db   "EGA.SYS driver not found", 0dh, 0ah, 24h
    revmsg  db   "revision $"
    crlf    db   0dh, 0ah, 24h
    ten     db   10
            mov  bx, 0              ; must be 0 for this call
            mov  ah, 0fah           ; fa = interrogate driver
            int  10h                ; interrogate!
            or   bx, bx             ; bx = 0 ?
            jnz  found              ; branch if driver present
            mov  dx, offset nopmsg  ; assume nopmsg in data segment
            mov  ah, 09h            ; 9 = print string
            int  21h                ; output not found message
            jmp  continue           ; that's all for now
    found:  mov  dx, offset gotmsg  ; assume gotmsg in data segment
            mov  ah, 09h            ; 9 = print string
            int  21h                ; output found message
            mov  dx, offset revmsg  ; assume revmsg in data segment
            mov  ah, 09h            ; 9 = print string
            int  21h                ; output "revision "
            mov  dl, es:[bx]        ; dl = major release number
            add  dl, "0"            ; convert to ASCII
            mov  ah, 2              ; 2 = display character
            int  21h                ; output major release number
            mov  dl, "."            ; dl = "."
            mov  ah, 2              ; 2 = display character
            int  21h                ; output a period
            mov  al, es:[bx+1]      ; al = minor release number

            xor  ah, ah             ; ah = 0
            idiv ten                ; al = 10ths, ah = 100ths
            mov  bx, ax             ; save ax in bx
            mov  dl, al             ; dl = 10ths
            add  dl, "0"            ; convert to ASCII
            mov  ah, 2              ; 2 = display character
            int  21h                ; output minor release 10ths
            mov  dl, bh             ; dl = 100ths
            add  dl, "0"            ; convert to ASCII
            mov  ah, 2              ; 2 = display character
            int  21h                ; output minor release 100ths
            mov  dx, offset crlf    ; assume crlf in data segment
            mov  ah, 09h            ; 9 = print string
            int  21h                ; output end of line
    continue:                       ; the end