Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rebooting the PC using JMP

101 views
Skip to first unread message

Alex May

unread,
Jan 2, 1999, 3:00:00 AM1/2/99
to
Hi,

Thanks for reading this message. I am new
to Assembly and have only been using it for
a few weeks now.

My question is, how do I reboot the computer
using JMP in MASM. I have tried to JMP to 0ffff:0 in
an attempt, but MASM doesn't like the '0ffff' and
says something along the lines of 'non-digit number'.

Any ideas??

Thanks in advance.

Alex

al...@mayfamily.demon.co.uk


Frédéric

unread,
Jan 2, 1999, 3:00:00 AM1/2/99
to
Alex May wrote:

> My question is, how do I reboot the computer
> using JMP in MASM. I have tried to JMP to 0ffff:0 in
> an attempt, but MASM doesn't like the '0ffff' and
> says something along the lines of 'non-digit number'.

Have you tried 0fffh:0?
--
Please do not reply by email
My address: f...@rz-online.de


Jim Morrison

unread,
Jan 2, 1999, 3:00:00 AM1/2/99
to
Here's how I do it:

PUBLIC _reboot
_reboot PROC FAR

MOV AX, 0F000h ; Address the BIOS re-IPL
PUSH AX
MOV AX, 0FFF0h
PUSH AX
CLI ; Shut off interrupts
RETF ; Boot

_reboot endp

James E. Morrison
astr...@i84.net
astrolabe web pages at: http://myhouse.com/mc/planet/astrodir/astrolab.htm


Alex May wrote in message <76lbq3$990$8...@winter.news.rcn.net>...


>Hi,
>
> Thanks for reading this message. I am new
>to Assembly and have only been using it for
>a few weeks now.
>

> My question is, how do I reboot the computer
>using JMP in MASM. I have tried to JMP to 0ffff:0 in
>an attempt, but MASM doesn't like the '0ffff' and
>says something along the lines of 'non-digit number'.
>

Martin Beck

unread,
Jan 2, 1999, 3:00:00 AM1/2/99
to
Alex May schrieb:

>
> Hi,
>
> Thanks for reading this message. I am new
> to Assembly and have only been using it for
> a few weeks now.
>
> My question is, how do I reboot the computer
> using JMP in MASM. I have tried to JMP to 0ffff:0 in
> an attempt, but MASM doesn't like the '0ffff' and
> says something along the lines of 'non-digit number'.
>
> Any ideas??
>
> Thanks in advance.
>
> Alex
>
> al...@mayfamily.demon.co.uk

I don't know MASM really, but first you should set an 'h' behind,
also I think one should use JMP FAR, but I don't know this.
So: JMP FAR 0ffffh:0

hth
Martin
--
E-Mail: Spi...@t-online.de
ICQ : 16102775

Dupe that floppy -- Spread the wealth and copy (Joe Koss)


Quad

unread,
Jan 3, 1999, 3:00:00 AM1/3/99
to
you forgot the 'h' after your hexadecimal number ...

Quad

TBD

unread,
Jan 3, 1999, 3:00:00 AM1/3/99
to
>Here's how I do it:
>
> PUBLIC _reboot
>_reboot PROC FAR
>
> MOV AX, 0F000h ; Address the BIOS re-IPL
> PUSH AX
> MOV AX, 0FFF0h
> PUSH AX
> CLI ; Shut off interrupts
> RETF ; Boot
>
>_reboot endp


Or if you're a size freak:

push -1
push 0
retf

or

mov ax, -1
push ax
dec ax
push ax

or

DB 0EAh, 0, 0, 0FFh, 0FFh

Its me !!!

unread,
Jan 4, 1999, 3:00:00 AM1/4/99
to

On 2 Jan 1999, Jim Morrison wrote:

> Here's how I do it:
>
> PUBLIC _reboot
> _reboot PROC FAR
>
> MOV AX, 0F000h ; Address the BIOS re-IPL
> PUSH AX
> MOV AX, 0FFF0h
> PUSH AX
> CLI ; Shut off interrupts
> RETF ; Boot
>
> _reboot endp
>
>

Simplier !

Reboot proc
db 0Eah
dw 0
dw 0FFFFh
Reboot endp

or same

Reboot2 proc
cli
db 0Eah
dw 0FFF0h
dw 0F000h
Reboot2 endp


SIowTalker

unread,
Jan 9, 1999, 3:00:00 AM1/9/99
to
If ya want it REALLY small, load up dubug and at the prompt type a100. Then
enter this JMP instruction:

JMP FFFF:0000

load the CX register with 5, name it to reboot.com with this command:
nREBOOT.COM
then type W.
voila! A 5 byte program that reboots your computer. Nothing gets better than
that =)

-Slow Talker-

Michael Tippach

unread,
Jan 10, 1999, 3:00:00 AM1/10/99
to
In article <777nnc$ln1$1...@winter.news.rcn.net>, SIowTalker
<siowt...@aol.com> writes

<binary>\DT</binary> is just 3 bytes for a .com file and about equally
as reliable ;-P

No JMP involved though...

Regards,

Michael Tippach


Benjamin Hauser

unread,
Jan 12, 1999, 3:00:00 AM1/12/99
to
"This time I really gotta ask...!"

Hi everybody, why don愒 you use this simple code for rebooting the computer
instead of all the complicated ones shown above?

bits 16
org 100h
int 19h


NASM makes a 2-byte-com file out of it, which reboots the computer
perfectly....so what are you guys talking about in this thread?

Maybe this is a stupid question, but I惴 very new to assembler (I just wrote
2 little proggys). So please don愒 flame me...hehe....actually it would be
very nice if someone explained me the use of the other sources.......!

Thanx and bye,
-Benjamin.


Michael Tippach schrieb in Nachricht <77atla$2ep$1...@winter.news.rcn.net>...

Michael Tippach

unread,
Jan 13, 1999, 3:00:00 AM1/13/99
to
In article <77g6k1$160$1...@winter.news.rcn.net>, Benjamin Hauser
<Benjami...@gmx.net> writes

>"This time I really gotta ask...!"
>
>Hi everybody, why don“t you use this simple code for rebooting the computer

>instead of all the complicated ones shown above?
>
>bits 16
>org 100h
>int 19h
>
>
>NASM makes a 2-byte-com file out of it, which reboots the computer
>perfectly....so what are you guys talking about in this thread?
>
>Maybe this is a stupid question, but I“m very new to assembler (I just wrote
>2 little proggys). So please don“t flame me...hehe....actually it would be

>very nice if someone explained me the use of the other sources.......!

No, you're perfectly right. INT 19 does just REBOOT, IOW it causes the
boot sector of whatever the boot device may be to be loaded into RAM and
do whatever it thinks it should do.

In most cases, however, this is not what you want as hooked interrupt
vectors, for instance, will then point into nowhere, basically (INT 19
does not re-initialize the IVT or anything the like, it just reloads the
boot sector).

So, literally, re_booting_ a PC, you are right in as far as INT 19 is
the shortest way of doing so.

Nevertheless, literally spoken, what you want to do most of the time is
_restarting_ the PC instead of simply _rebooting_ it. That's where INT19
fails most of the time, unless it's beeing converted into a reset by a
driver/ memory manager etc. anyway.

BTW, my post regarding the subject was just a joke in response to that
"5 bytes is the minimum" - claim. What it realy does is causing a triple
fault which normally would be detected by the chip set and be converted
into a reset if, and only if the CPU is in real mode:

pop sp ; sp = 0 for a COM file
inc sp ; sp = 1
push sp ; can't cross a 0 boundary -> stack fault
; -> can't push -> double fault
; -> can't push -> triple fault

Again, this was just a joke and the practical use of that kind of thing
is very limited nowadays where it's better to look into things like
ExitWindowsEx() instead.


Regards,

Michael Tippach

Benjamin Hauser

unread,
Jan 14, 1999, 3:00:00 AM1/14/99
to
Thanx for your answer, now I got the point!
BTW, nice joke! :)

CU,
-Benjamin.


Michael Tippach schrieb in Nachricht <77gs54$2pu$1...@winter.news.rcn.net>...

>No, you're perfectly right. INT 19 does just REBOOT, IOW it causes the
>boot sector of whatever the boot device may be to be loaded into RAM and
>do whatever it thinks it should do.
>

(...)
>
>
>Regards,
>
>Michael Tippach

Richard Day

unread,
Jan 26, 1999, 3:00:00 AM1/26/99
to
Benjamin Hauser wrote:

> "This time I really gotta ask...!"
>
> Hi everybody, why don“t you use this simple code for rebooting the computer
> instead of all the complicated ones shown above?
>
> bits 16
> org 100h
> int 19h
>
> NASM makes a 2-byte-com file out of it, which reboots the computer
> perfectly....so what are you guys talking about in this thread?
>
> Maybe this is a stupid question, but I“m very new to assembler (I just wrote
> 2 little proggys). So please don“t flame me...hehe....actually it would be
> very nice if someone explained me the use of the other sources.......!
>

> Thanx and bye,
> -Benjamin.
>


> Michael Tippach schrieb in Nachricht <77atla$2ep$1...@winter.news.rcn.net>...
> >In article <777nnc$ln1$1...@winter.news.rcn.net>, SIowTalker
> ><siowt...@aol.com> writes
> >>If ya want it REALLY small, load up dubug and at the prompt type a100.
> Then
> >>enter this JMP instruction:
> >>
> >>JMP FFFF:0000
> >>
> >>load the CX register with 5, name it to reboot.com with this command:
> >>nREBOOT.COM
> >>then type W.
> >>voila! A 5 byte program that reboots your computer. Nothing gets better
> than
> >>that =)
> >
> ><binary>\DT</binary> is just 3 bytes for a .com file and about equally
> >as reliable ;-P
> >
> >No JMP involved though...
> >
> >Regards,
> >
> >Michael Tippach
> >

actually int19 doesn't work for all comps :P

and the preferred method of rebooting the pc is to use the keyboard controller
actually :)


0 new messages