home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast.iso / bootutil / reboot.asm < prev    next >
Assembly Source File  |  1994-03-04  |  2KB  |  80 lines

  1.     PAGE    ,132
  2.     TITLE    REBOOT -- Command to Force a Reboot
  3.     %OUT    History
  4.  
  5. ; reboot.asm  20 Mar 85  Craig Milo Rogers at USC/ISI
  6. ;    Copied from Info-IBMPC Digest V4 #34, made format changes,
  7. ; and fixed bugs.  The original was by Joeseph M. Newcomer,
  8. ; based on REBOOT.SEQ in the Info-IBMPC library.
  9.  
  10. ;    This program reboots your IBM-PC, but omits the memory
  11. ; diagnostic.  WARNING!  There is code here which is very
  12. ; BIOS dependent!
  13.  
  14. ;    The following commands should remake this program:
  15. ;        MASM REBOOT;
  16. ;        LINK REBOOT;
  17. ;        EXE2BIN REBOOT
  18. ;        RENAME REBOOT.BIN REBOOT.COM
  19. ;        DEL REBOOT.EXE
  20.  
  21.     PAGE
  22.     %OUT    BIOS RAM Locations
  23.  
  24. BIOSCOM    SEGMENT AT 40H
  25.     ORG    BIOSCOM+72H
  26. RESET_FLAG DW            ; Warm/cold restart flag.
  27. BIOSCOM    ENDS
  28.  
  29.     PAGE
  30.     %OUT    Start of Program and Data
  31.  
  32. ;    The following location (RESTART) holds the address of the
  33. ; label START in the IBMPC ROM BIOS.  Jumping to START does a cold
  34. ; boot, but skips the RAM check step.  Warning!  The address of START
  35. ; may be different in IBM-PC clones, or even in later releases of IBM
  36. ; BIOS.
  37.  
  38. CODESEG    SEGMENT    'CODE'        ; Start the code segment
  39.     ASSUME    CS:CODESEG
  40.     ASSUME    DS:CODESEG
  41.  
  42.     ORG    100H        ; Beginning of code area.
  43. BEGIN:    JMP    SHORT CLRBFI    ; Jump around data area.
  44.  
  45. RESTART  LABEL    DWORD
  46.     DW    0E05BH        ; IP for reboot
  47.     DW    0F000H        ; CS for reboot
  48.  
  49. MSG    DB    'Strike any key to REBOOT$'
  50.  
  51.     PAGE
  52.     %OUT    Code
  53.  
  54. CLRBFI:                ; Drain typein buffer.
  55.     mov    AH,1
  56.     int    16H        ; ask keyboard status (Z holds result)
  57.      jz    clear        ; nothing pending, go on
  58.     mov    AH,0
  59.     int    16H        ; read character at keyboard
  60.     jmp    clrbfi        ; ignore it, see if any left
  61.  
  62. CLEAR:
  63.     MOV    DX,OFFSET MSG    ; Get address of 'Strike any key' message.
  64.     MOV    AH,9        ; Print String DOS function.
  65.     INT    21H        ; Call DOS.
  66.  
  67.     MOV    AH,8        ; Input No Echo, Wait If Needed
  68.     INT    21H        ; wait for key to be struck
  69.  
  70.     MOV    AX,SEG BIOSCOM    ; Point to BIOS data segment.
  71.     MOV    DS,AX
  72.     ASSUME    DS:BIOSCOM
  73.  
  74.     MOV    RESET_FLAG,1234H ; Set 'Warm Start' flag.
  75.     JMP    RESTART        ; Jump into BIOS.
  76.  
  77. CODESEG    ENDS
  78.  
  79.     END BEGIN
  80.