home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / ckcompaq.asm < prev    next >
Assembly Source File  |  1994-03-04  |  2KB  |  76 lines

  1.  
  2.     PAGE    60,132
  3. ;
  4. ; CKCOMPAQ : A program to check for the COMPAQ copyright notice in the BIOS ROM.
  5. ;
  6. ;    Tom Brengle (BRENGLE%LLL@LLL.MFE)
  7. ;
  8. ;    Lawrence Livermore National Laboratory
  9. ;    P. O. Box 5511, L-630
  10. ;    Livermore, California  94550
  11. ;
  12. ; CKCOMPAQ checks for COMPAQ Corp's copyright notice in the BIOS ROM.  If it
  13. ; finds the correct notice, the program sets the ERRORLEVEL to zero and exits.
  14. ; Otherwise, it sets the ERRORLEVEL to one and exits.  This program is useful
  15. ; for controlling the installation of hardware-dependent software at boot-up
  16. ; time through the use of IF ERRORLEVEL commands in the AUTOEXEC.BAT file.
  17. ;
  18. ; To build CKCOMPAQ :
  19. ;
  20. ;    1.  Assemble CKCOMPAQ.
  21. ;
  22. ;        MASM CKCOMPAQ;
  23. ;
  24. ;    2.  Link CKCOMPAQ;
  25. ;
  26. ;        LINK CKCOMPAQ;
  27. ;
  28. ;    3.  Convert CKCOMPAQ.EXE to CKCOMPAQ.COM;
  29. ;
  30. ;        EXE2BIN CKCOMPAQ.EXE CKCOMPAQ.COM
  31. ;
  32. ;
  33. ROM_BIOS_Code    segment at 0F000h    ; Locate the ROM BIOS code segment.
  34.     org    0A000h
  35. ROM_Notice    db    69d dup (?)
  36. ROM_BIOS_Code    ends
  37.  
  38. code_seg    segment
  39.     assume    cs:code_seg
  40.     org    100h
  41. Begin:    jmp    CkCOMPAQ
  42.  
  43. COMPAQ_Notice    db    '(C) Copyright COMPAQ Computer Corporation, 1982, All rights reserved.',0
  44.  
  45. CkCOMPAQ    proc    near
  46.     assume    ds:ROM_BIOS_Code    ; Set up ROM BIOS data segment.
  47.     mov    bx,ROM_BIOS_Code
  48.     mov    ds,bx
  49.  
  50.     mov    si,offset COMPAQ_Notice ; Set up pointers to the two strings.
  51.     mov    di,offset ROM_Notice
  52.  
  53. Loop:    mov    al,cs:[si]        ; Get the next char of the COMPAQ notice.
  54.     cmp    al,0            ; Is it the trailing null?
  55.     je    COMPAQ_OK        ; Yes, then the strings match.
  56.     cmp    al,ds:[di]        ; Otherwise, check it against the next char of the ROM notice.
  57.     jne    Not_COMPAQ        ; If not the same, the strings are different.
  58.     inc    si            ; Increment pointers...
  59.     inc    di
  60.     jmp    Loop            ; ... and loop back for next char.
  61.  
  62. Not_COMPAQ:                ; Here if strings don't match.
  63.     mov    al,1            ; Set the error level to one.
  64.     mov    ah,4Ch            ; Exit to DOS.
  65.     int    21h
  66.  
  67. COMPAQ_OK:                ; Here if strings match.
  68.     mov    al,0            ; Set the error level to zero.
  69.     mov    ah,4Ch            ; Exit to DOS.
  70.     int    21h
  71.  
  72. CkCOMPAQ    endp
  73. code_seg    ends
  74.  
  75.     end    Begin
  76.