Software Archive
Read-only legacy content
Announcements
This community is designed for sharing of public information. Please do not share Intel or third-party confidential information here.
17065 Discussions

HLT vs JMP $

vikranth958
Beginner
254 Views

Hi,

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.

Regards,

Vikranth

0 Kudos
3 Replies
jim_dempsey
Beginner
254 Views

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

JMP stays at JMP location

HLT is privleged of course.

Jim

Sven_Olaf_K_
Beginner
254 Views

how about:

WAITFOREVER:

HLT

JMP WAITFOREVER

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.

SergeyKostrov
Valued Contributor II
254 Views
>>...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?
Reply