HLT vs JMP $

HLT vs JMP $


Can anybody help me know the difference between HLT and JMP $ ?

Is there any possibility that NMI is generated during processor HLT state andif it occurs, how the processor reacts to it.

If NMI occurs during HLT where will the processor return after handling it.

Thanks in advance.



4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

An enabled interrupt, NMI, or a reset will resume execution after the HLT.

JMP stays at JMP location

HLT is privleged of course.


how about:




not sure on energy efficiency but i'd think HLT when no interrupts take place takes less effort than bouncing the jmp to itself all the time. (someone from intel is kindly invited to give energy efficiency details on both methods for all models, 8088 and up :P (it's probably a lot different for newer cpus with powersaving modes and tons of cache inside).. it can just sit there and wait for an interrupt and do nothing but on the other hand, compared to the JMP to itself, on that last one the instruction pointer doesn't change, not sure what takes more 'effort' for the cpu and therefore more power.

>>...HLT is privleged of course.

This is a right point. Another thing is that HLT will be executed in a context of the current thread pinned to some logical CPU that executes that thread. Could you explain why do you need to execute HLT instruction instead of PAUSE?

Leave a Comment

Please sign in to add a comment. Not a member? Join today