I'm thinking that's not at all what he wants. I would suggest beginning with something like
ACPI. Note that not all machines are equipped with this ability. If you're dealing with some relatively common machine, a peep at the BIOS should tell you if APM is available. For something like a desktop PC, you're getting into the driver area, which suggests that you can't just pop some inline assembly into your app.