I once did some tutorials on osdev.org and one interesting point was how the CPU is set into idle mode.
Because when no task has work to do you want to put the CPU into idle mode and not consume any current.
On x86 it is done like this:
JMP .
You might think this instruction will hang up the CPU making a hardware reset necessary (as expected). But instead it puts the CPU in idle mode.
Is this the only instruction or are there other instructions used in the past (on different CPUs)?
HLTdidn’t actually reduce power consumption on x86 until the 386SL in 1991. Some earlier x86 CPUs could be powered down, but not usingHLT. – Stephen Kitt Dec 09 '22 at 21:29HLT! – Stephen Kitt Dec 10 '22 at 13:56