home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / 80x0393.zip / REBOOT.FAQ < prev    next >
Text File  |  1993-03-30  |  2KB  |  53 lines

  1. Fri 29 Jan 93  8:34
  2. By: Yousuf Khan
  3. To: All
  4. Re: FAQ: How to Reboot
  5. ------------------------------------------------------------------------
  6.  
  7. Q3) How do I reboot my computer in software?
  8.  
  9.                                   ***
  10.  
  11. A3) Although there are many variations to this program, they all
  12. do basically the same thing. There are two forms of rebooting.
  13. First one is a "warm boot", which is like what happens when you
  14. hit the ctlr-alt-del keyboard combination, this bypasses the
  15. memory counter. Second form is a "cold boot", which is like what
  16. happens when you hit the reset button or turn the power off and
  17. on, this does not bypass the memory counter. Let's demonstrate
  18. through a sample program.
  19.  
  20. BDSeg   segment at 40h          ;-this is the location of the
  21.                                 ;Bios Data Segment (BDSeg).
  22.         org     72h             ;-take us to an offset 72h
  23.                                 ;from the beginning of BDSeg
  24. FLAG    dw      ?               ;-we set this memory location
  25.                                 ;to 1234h if we want a warm
  26.                                 ;boot. Any other value for a
  27.                                 ;cold boot.
  28. BDSeg   ends                    ;-signifies end of this segment
  29.  
  30. BOOTSeg segment at 0FFFFh       ;-segment close to end of physical
  31.                                 ;memory
  32. BOOTLOC:                        ;-this is where to jump to
  33. BOOTSeg ends
  34.  
  35. CSeg    segment 'code'          ;-beginning of our code segment
  36.         org     100h            ;-required for *.com file
  37. start:
  38.         mov     ax, BDSeg
  39.         mov     ds, ax          ;-set DS to segment of BDSeg
  40.         assume CS:CSeg, DS:BDSeg
  41.         mov     [FLAG], 1234h   ;-put the value of 1234h into
  42.                                 ;memory location occupied by
  43.                                 ;FLAG for a warm boot. For
  44.                                 ;cold boot put any other value in
  45.                                 ;suggested value is 0000h
  46.         jmp far ptr BOOTLOC     ;-now jump to this memory location
  47. CSeg    ends
  48.         end     start
  49.  
  50. Note this program is only guaranteed to work while in plain Dos.
  51. It may or may not work in Dos multitaskers and other operating
  52. systems.
  53.