home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / DOS_HELP / ADVMSDOS.ZIP / COMPAQ.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-06-19  |  1.4 KB  |  63 lines

  1.         page    55,132
  2.         name    compaq
  3.         title    'COMPAQ - check if Compaq machine'
  4.         
  5. ;
  6. ; COMPAQ utility to test whether host machine is    
  7. ; one of the Compaq family of personal computers.
  8. ;
  9. ; Returns ERRORLEVEL <>0 if a Compaq, =0 if not.
  10. ;
  11. ; Copyright (c) 1984 Ray Duncan
  12. ;
  13. ; To assemble, link, and convert this program into 
  14. ; a COM file, follow these steps:
  15. ;
  16. ;    C>MASM COMPAQ;
  17. ;     C>LINK COMPAQ;
  18. ;    C>EXE2BIN COMPAQ.EXE COMPAQ.COM
  19. ;    C>DEL COMPAQ.EXE
  20. ;
  21. ; Ignore the message "Warning: no stack segment" from the Linker.
  22. ;
  23.  
  24. cseg        segment    para public 'CODE'
  25.         
  26.         org    100h
  27.  
  28.         assume    cs:cseg,ds:cseg,es:cseg,ss:cseg
  29.  
  30. compaq        proc    near
  31.  
  32.         mov    ax,0f000h    ;search ROM BIOS for
  33.         mov    es,ax        ;COMPAQ copyright notice
  34.         mov    di,0a000h
  35.         mov    cx,05fffh
  36. compaq1:    mov    al,'C'        ;look for initial C
  37.         repnz scasb
  38.         jnz    compaq2        ;ROM exhausted, COMPAQ not found
  39.         push    di        ;save current ROM pointer
  40.         push    cx
  41.         push    si
  42.         mov    cx,6        ;found C, try & match 'COMPAQ'
  43.          mov    si,offset compaq_name
  44.         dec    di
  45.         repz cmpsb
  46.         pop    si        ;restore ROM pointer
  47.         pop    cx
  48.         pop    di
  49.         jnz    compaq1        ;jump, strings didn't match
  50.         mov    al,1        ;return T for Compaq=True
  51.         jmp    compaq3
  52. compaq2:    mov    al,0        ;return F for Compaq=False
  53. compaq3:    mov    ah,04ch
  54.         int    21h
  55. compaq        endp
  56.  
  57. compaq_name    db    'COMPAQ'
  58.     
  59. cseg        ends    
  60.  
  61.         end    compaq
  62.  
  63.