How to Reboot Your Machine Within a MASM Application

Last reviewed: January 6, 1995
Article ID: Q68805
The information in this article applies to:
  • Microsoft Macro Assembler for MS-DOS, version 5.0, 5.1, 5.1a, 6.0, 6.0a, and 6.0b

SUMMARY

You can perform a complete reboot (cold boot) on an 8086-based machine by jumping to the address FFFF:0000. This action also reboots many 80286 and 80386 machines. The address contains a jump instruction that leads to the machine's initialization code. For this method to succeed, your machine must be in real-mode operation.

MORE INFORMATION

To prevent a memory check on IBM and many compatibles (warm boot), you should store the value 0 x 1234 in the memory location at 0040:0072. On 100-percent IBM BIOS compatible machines, an alternative method is to call int 19h instead of jumping to the address mentioned above.

Sample Code

; Assemble options needed: none

.MODEL small

.CODE

Start:

    mov ax, @data                 ; Load ds with data segment
    mov ds, ax

    mov ax, 40h                   ; These three lines cause a memory
    mov es, ax                    ; test NOT to be performed. To
    mov WORD PTR es:[72h], 1234h  ; do a memory test, remove them.

    jmp DWORD PTR b_vec           ; Jump to the reboot address

.DATA
b_vec   DW 00000h                 ; Offset of reboot vector
        DW 0FFFFh                 ; Segment of reboot vector

.STACK

END Start


Additional reference words: 5.10 5.10a 6.00 6.00a 6.00b
KBCategory: kbprg
KBSubCategory: MASMLngIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 6, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.