home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / mouse / lib / ega / examples / faexamp.asm < prev   
Encoding:
Assembly Source File  |  1988-08-11  |  1.6 KB  |  51 lines

  1. ; The following example interrogates the mouse driver and displays the
  2. ; results.
  3.  
  4. gotmsg    db    "mouse driver found", 0dh, 0ah, 24h
  5. nopmsg    db    "mouse drive not found", 0dh, 0ah, 24h
  6. revmsg    db    "revision $"
  7. crlf    db    0dh, 0ah, 24h
  8.  
  9. ten    db    10
  10.  
  11.     mov    bx, 0            ; must be 0 for this call
  12.     mov    ah, 0fah        ; fa = interrogate driver
  13.     int    10h            ; interrogate!
  14.     or    bx, bx            ; bx = 0 ?
  15.     jnz    found            ; branch if driver present
  16.     mov    dx, offset nopmsg    ; assume nopmsg in data segment
  17.     mov    ah, 09h            ; 9 = print string
  18.     int    21h            ; output not found message
  19.     jmp    continue        ; that's all for now
  20.  
  21. found:    mov    dx, offset gotmsg    ; assume gotmsg in data segment
  22.     mov    ah, 09h            ; 9 = print string
  23.     int    21h            ; output found message
  24.     mov    dx, offset revmsg    ; assume revmsg in data segment
  25.     mov    ah, 09h            ; 9 = print string
  26.     int    21h            ; output "revision"
  27.     mov    dl, es:[bx]        ; dl = major release number
  28.     add    dl, "0"            ; convert to ascii
  29.     mov    ah, 2            ; 2 = display character
  30.     int    21h            ; output major release number
  31.     mov    dl, "."            ; dl = "."
  32.     mov    ah, 2            ; 2 = display character
  33.     int    21h            ; output a period
  34.     mov    al, es:[bx+1]        ; al = minor release number
  35.     xor    ah, ah            ; ah = 0
  36.     idiv    ten            ; al = 10ths, ah = 100ths
  37.     mov    bx, ax            ; save ax in bx
  38.     mov    dl, al            ; dl = 10ths
  39.     add    dl, "0"            ; convert to ascii
  40.     mov    ah, 2            ; 2 = display character
  41.     int    21h            ; output minor release 10ths
  42.     mov    dl, bh            ; dl = 100ths
  43.     add    dl, "0"            ; convert to ascii
  44.     mov    ah, 2            ; 2 = display character
  45.     int    21h            ; output minor release 100ths
  46.     mov    dx, offset crlf        ; assume crlf in data segment
  47.     mov    ah, 09h            ; 9 = print string
  48.     int    21h            ; output end of line
  49.  
  50. continue:                ; the end
  51.