home *** CD-ROM | disk | FTP | other *** search
- PAGE ,132
- TITLE REBOOT -- Command to Force a Reboot
- %OUT History
-
- ; reboot.asm 20 Mar 85 Craig Milo Rogers at USC/ISI
- ; Copied from Info-IBMPC Digest V4 #34, made format changes,
- ; and fixed bugs. The original was by Joeseph M. Newcomer,
- ; based on REBOOT.SEQ in the Info-IBMPC library.
-
- ; This program reboots your IBM-PC, but omits the memory
- ; diagnostic. WARNING! There is code here which is very
- ; BIOS dependent!
-
- ; The following commands should remake this program:
- ; MASM REBOOT;
- ; LINK REBOOT;
- ; EXE2BIN REBOOT
- ; RENAME REBOOT.BIN REBOOT.COM
- ; DEL REBOOT.EXE
-
- PAGE
- %OUT BIOS RAM Locations
-
- BIOSCOM SEGMENT AT 40H
- ORG BIOSCOM+72H
- RESET_FLAG DW ; Warm/cold restart flag.
- BIOSCOM ENDS
-
- PAGE
- %OUT Start of Program and Data
-
- ; The following location (RESTART) holds the address of the
- ; label START in the IBMPC ROM BIOS. Jumping to START does a cold
- ; boot, but skips the RAM check step. Warning! The address of START
- ; may be different in IBM-PC clones, or even in later releases of IBM
- ; BIOS.
-
- CODESEG SEGMENT 'CODE' ; Start the code segment
- ASSUME CS:CODESEG
- ASSUME DS:CODESEG
-
- ORG 100H ; Beginning of code area.
- BEGIN: JMP SHORT CLRBFI ; Jump around data area.
-
- RESTART LABEL DWORD
- DW 0E05BH ; IP for reboot
- DW 0F000H ; CS for reboot
-
- MSG DB 'Strike any key to REBOOT$'
-
- PAGE
- %OUT Code
-
- CLRBFI: ; Drain typein buffer.
- mov AH,1
- int 16H ; ask keyboard status (Z holds result)
- jz clear ; nothing pending, go on
- mov AH,0
- int 16H ; read character at keyboard
- jmp clrbfi ; ignore it, see if any left
-
- CLEAR:
- MOV DX,OFFSET MSG ; Get address of 'Strike any key' message.
- MOV AH,9 ; Print String DOS function.
- INT 21H ; Call DOS.
-
- MOV AH,8 ; Input No Echo, Wait If Needed
- INT 21H ; wait for key to be struck
-
- MOV AX,SEG BIOSCOM ; Point to BIOS data segment.
- MOV DS,AX
- ASSUME DS:BIOSCOM
-
- MOV RESET_FLAG,1234H ; Set 'Warm Start' flag.
- JMP RESTART ; Jump into BIOS.
-
- CODESEG ENDS
-
- END BEGIN
-