From: anonymous@bogus_address.com
Newsgroups: comp.lang.asm.x86
Subject: Re: Shutting down the PC
Date: Sun, 2 Dec 2001 23:55:56 +0000 (UTC)
Message-ID: <u0lf0pkacl10e5@corp.supernews.com>

On 2001-12-02 nikolas_garofil@hotmail.com@telenet-ops.be said:

   >How can I shutdown the computer (Pentium IV)
   >Has Intel provided a interrupt for this ?

It's a ROM BIOS function: Interrupt 15h, Function 53h
with various sub-functions.

Fundamentally, the process is as follows:

1. Check for presence of APM.
     If not available, error out.
     If available, continue.

2. Check the APM version number.
     If version number is too low, error out.
     If version number is correct (or higher), continue.

3. Make a connection (real or protected mode) to APM.
     If error occurs, abort.
     If a previous connection exists, error out.
     If connection is successful and no previous connections
     exist, continue.

4. Enable latest APM version number.
     If error occurs, abort.
     If successful, continue.

5. Enable CPU management function.
     If error occurs, abort.
     If successful, continue.

6. Specify desired devices.
     If error occurs, abort.
     If successful, continue.

7. Call power-down.
     If error occurs, abort.
     If successful, the computer will 'power down.'

Have fun! :)
