home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / pb / library6 / reboot.doc < prev    next >
Text File  |  1990-08-16  |  1KB  |  43 lines

  1. **** NOTICE ****
  2.   This is a potentially hazardous routine, and I make no claims whatsoever
  3.   about it's functionability or suitability for a given purpose.  By using
  4.   this routine, you accept any problems that may occur by said use.
  5. ****************
  6.  
  7.  
  8. Subroutine:  Reboot
  9. Purpose:     Allow user to perform a warm start during program execution
  10. Warnings:    You should ensure that all files have been closed properly
  11.          before calling this subroutine.  Mis-use can (and probably
  12.          will) result in corrupt data files.
  13. Setup:         Link the object file into the main program and declare the
  14.          subroutine:
  15.            $link "REBOT.OBJ"
  16.            declare sub Reboot()
  17. Calling:     CALL Reboot
  18.  
  19.  
  20. While other methods can be used to reboot a computer, this one takes
  21. up only 9 bytes.  This is the only method that I have found that will
  22. reliably reboot my computers.  Following is the .ASM code.....
  23.  
  24.     Public Reboot        ; declare Reboot as a public subroutine
  25.  
  26. Code    Segment    Byte        ; define code segment
  27.     assume cs:code        ; tell the compiler about the code segment
  28.  
  29. Reboot    Proc    Far        ; reboot is a far process
  30.  
  31.     mov    ax,0ffffh    ; push the segment
  32.     push    ax        ; and the offset
  33.     mov    ax,0000h    ; of the bios warm start routine
  34.     push    ax        ; onto the stack.
  35.     retf            ; run the routine.
  36.  
  37. Reboot    EndP            ; end of reboot process
  38.  
  39. Code    EndS            ; end of code segment
  40.  
  41.     End            ; end of .asm program
  42.  
  43.