Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!bbn!gatech!emcard!stiatl!todd From: todd@stiatl.UUCP (Todd Merriman) Newsgroups: comp.sys.ibm.pc Subject: re: How do I reboot from software? Message-ID: <2106@stiatl.UUCP> Date: 12 Dec 88 13:29:36 GMT Reply-To: todd@stiatl.UUCP (Todd Merriman) Organization: Sales Technologies Inc., Atlanta, GA Lines: 101 ifdef DOCUMENTATION ; **************************************************************************** REBOOT.ASM 12/18/87 Todd Merriman .MODULE reboot .LIBRARY clib .TYPE function .APPLICATION system .SYSTEM msdos .AUTHOR Todd Merriman .LANGUAGE Assembly .DESCRIPTION Reboot the computer .ARGUMENTS void reboot(); .NARRATIVE The reboot function transfers program control to the CPU reset vector, and a system reset is performed. This could be used in a case where a device driver was modified. .CAUTION Be sure there are no open files, or any I/O not completed. .RETURNS void .NOTICE Copyright (c) 1987 Future Communications, Atlanta, Georgia .ENDOC END DOCUMENTATION ; **************************************************************************** endif .XLIST INCLUDE \HEADER\C.MAC ; symbols and macros for Microsoft .LIST ; **************************************************************************** ; data ; **************************************************************************** DSEG ; begin data section RES_VEC DW 0FFF0H,0F000H ; reset vector ENDDS ; end data section ; **************************************************************************** ; code ; **************************************************************************** PSEG ; begin program section CFUN reboot ; C function declaration PUSH BP MOV BP,SP LEA SI,RES_VEC ; load reset vector JMP DWORD PTR DS:[SI] ; jump there POP BP ; this code for good form only RET CFEND reboot ; end C function ENDPS ; end program section END ; end assembly ; **************************************************************************** ; reboot program ; this is a test for the reboot function ; **************************************************************************** PAGE 59,132 ; ; Outline for assembly programs to .COM files ; .XLIST INCLUDE \LAT\HEADER\CSUB.MAC .LIST CODE SEGMENT PUBLIC ASSUME CS:CODE, DS:CODE, SS:CODE, ES:CODE ORG 100H ; .COM origin MAIN PROC FAR START: CCALL reboot INT 20H ; to DOS MAIN ENDP CODE ENDS END START ; **************************************************************************** ; End REBOOT.ASM ; ****************************************************************************