Page 1 of 1

The hlt instruction

Posted: Fri Jan 04, 2008 11:07 pm
by michael
Sorry I just keep asking the complicated questions :P Well when the hlt instruction is um executed will the cpu just:

Not increase the instruction pointer and therefore execute hlt until an interupt occurs, or

Actully turn off the cpu/put it in idle?

Cuz i heard thats what Vista does, well that and downclock the cpu when its not in use but I think thats asking a litle to much :lol:

Posted: Sun Jan 06, 2008 4:23 pm
by Mike
Hey,
Sorry I just keep asking the complicated questions :)
No worries--That is what we are here for ;)

HLT does indeed temporally stop the processor. In other words, it is in an idle state until an interrupt happens to take it out of the idle state, or the NMI pin is activated.

increase the instruction

Posted: Fri Nov 07, 2008 4:16 pm
by Liza
Well when the hlt instruction is um executed will the cpu just:

Not increase the instruction pointer and therefore execute hlt until an interupt occurs, or

Actully turn off the cpu/put it in idle?

Posted: Sat Nov 08, 2008 3:57 pm
by Mike
Actully turn off the cpu/put it in idle?
HLT puts the processor into its HALT state. Only an enabled interrupt (Including NMI), debug exception, BINIT# signal, INIT# signal, or a RESET# signal can resume operation.

If a processor supports hyperthreading, or this is a multi-processor system, only the logical processor that executes HLT will be halted. The other processors continue execution. The system software or executive would need to HLT all logical processors in order to put each logical processor into a HLT state.