Knowledge

HLT (x86 instruction)

Source 📝

174:
includes an instruction or sleep mode which halts the processor until more work needs to be done. In interrupt-driven processors, this instruction halts the CPU until an external interrupt is received. On most architectures, executing such an instruction allows the processor to significantly reduce
44:
is fired. Interrupts are signals sent by hardware devices to the CPU alerting it that an event occurred to which it should react. For example, hardware timers send interrupts to the CPU at regular intervals.
221:
to decide whether other processes are runnable; if not. If every process is sleeping or waiting, it will normally execute a HLT instruction to cut power usage until the next hardware interrupt.
301: 115:
and in Microsoft's tests it saved 5%. Some of the first 100 MHz DX chips had a buggy HLT state, prompting the developers of
327: 247: 281: 257: 213:(API) provided for that purpose by the operating system when no more work can be done, such as Linux's 119:
to implement a "no-hlt" option for use when running on those chips, but this was fixed in later chips.
407: 236: 206: 107:
prior to 6.0 and was not specifically designed to reduce power consumption until the release of the
352: 37: 218: 402: 282:"Intel 64 and IA-32 Architectures Software Developer's Manual: Instruction Set Reference A-Z" 242: 23: 377: 179:
for sleeping and idling. In most processors, halting (instead of looping) also reduces the
8: 192: 65: 217:. This is referred to as "yielding" the processor. This allows the operating system's 122:
Intel has since introduced additional processor-yielding instructions. These include:
56:
instruction when there is no immediate work to be done, putting the processor into an
180: 33: 209:. Because of this, it is often best practice in application programming to use the 49: 202: 171: 111:
processor in 1994. MS-DOS 6.0 provided a POWER.EXE that could be installed in
396: 175:
its power usage and heat output, which is why it is commonly used instead of
331: 176: 262: 252: 112: 61: 57: 133:
intended for spin loops. Available to userspace (low-privilege rings).
205:
access, it can only be run by privileged system software such as the
108: 41: 104: 69: 116: 230: 144: 130: 210: 20: 328:"POWER.EXE and Advanced Power Management (APM) Support" 161:(userspace monitor/mwait). Available to userspace. 394: 99:All x86 processors from the 8086 onward had the 83:On ARM processors, the similar instructions are 64:, for example, this instruction is run in the " 302:"Why does DOS use 100% CPU under Virtual PC?" 186: 231:Advanced Configuration and Power Interface 16:X86 CPU instruction which pauses execution 395: 378:"sched_yield(2) - Linux manual page" 103:instruction, but it was not used by 13: 14: 419: 211:application programming interface 94: 370: 345: 320: 294: 274: 170:Almost every modern processor 40:(CPU) until the next external 1: 268: 353:"The Linux BootPrompt-HowTo" 258:Instruction set architecture 36:instruction which halts the 7: 224: 147:for thread synchronization. 10: 424: 190: 165: 68:". On x86 processors, the 237:Advanced Power Management 158: 154: 150: 140: 136: 126: 87:(Wait For Interrupt) and 187:Use in operating systems 183:of the next interrupt. 38:central processing unit 243:Computer architecture 201:instruction requires 24:computer architecture 248:Halt and Catch Fire 193:Sleep (system call) 66:System Idle Process 308:. 20 December 2004 197:Since issuing the 153:(timed pause) and 91:(Wait For Event). 50:operating systems 34:assembly language 415: 408:X86 instructions 388: 387: 385: 384: 374: 368: 367: 365: 363: 349: 343: 342: 340: 339: 330:. Archived from 324: 318: 317: 315: 313: 298: 292: 291: 289: 288: 278: 216: 200: 160: 156: 152: 142: 138: 128: 102: 90: 86: 79: 75: 55: 30: 423: 422: 418: 417: 416: 414: 413: 412: 393: 392: 391: 382: 380: 376: 375: 371: 361: 359: 351: 350: 346: 337: 335: 326: 325: 321: 311: 309: 300: 299: 295: 286: 284: 280: 279: 275: 271: 227: 214: 198: 195: 189: 172:instruction set 168: 100: 97: 88: 84: 77: 73: 53: 28: 17: 12: 11: 5: 421: 411: 410: 405: 390: 389: 369: 344: 319: 293: 272: 270: 267: 266: 265: 260: 255: 250: 245: 240: 234: 226: 223: 191:Main article: 188: 185: 167: 164: 163: 162: 148: 134: 96: 95:History on x86 93: 15: 9: 6: 4: 3: 2: 420: 409: 406: 404: 401: 400: 398: 379: 373: 358: 354: 348: 334:on 2014-09-27 333: 329: 323: 307: 306:microsoft.com 303: 297: 283: 277: 273: 264: 261: 259: 256: 254: 251: 249: 246: 244: 241: 238: 235: 232: 229: 228: 222: 220: 215:sched_yield() 212: 208: 204: 194: 184: 182: 178: 173: 149: 146: 135: 132: 125: 124: 123: 120: 118: 114: 110: 106: 92: 81: 71: 67: 63: 59: 51: 46: 43: 39: 35: 32:(halt) is an 31: 25: 22: 403:Machine code 381:. Retrieved 372: 360:. Retrieved 357:www.faqs.org 356: 347: 336:. Retrieved 332:the original 322: 310:. Retrieved 305: 296: 285:. Retrieved 276: 196: 177:busy waiting 169: 121: 98: 82: 47: 27: 18: 362:18 November 312:18 November 397:Categories 383:2020-09-02 338:2015-09-27 287:2012-03-01 269:References 263:NOP (code) 253:Idle (CPU) 113:CONFIG.SYS 62:Windows NT 58:idle state 52:execute a 219:scheduler 109:Intel DX4 42:interrupt 225:See also 155:UMONITOR 181:latency 166:Process 137:MONITOR 19:In the 233:(ACPI) 207:kernel 203:ring 0 159:UMWAIT 151:TPAUSE 105:MS-DOS 70:opcode 239:(APM) 141:MWAIT 127:PAUSE 117:Linux 60:. In 48:Most 364:2018 314:2018 145:SSE3 131:SSE2 78:0xF4 199:HLT 143:in 129:in 101:HLT 89:WFE 85:WFI 76:is 74:HLT 72:of 54:HLT 29:HLT 21:x86 399:: 355:. 304:. 80:. 26:, 386:. 366:. 341:. 316:. 290:. 157:/ 139:/

Index

x86
computer architecture
assembly language
central processing unit
interrupt
operating systems
idle state
Windows NT
System Idle Process
opcode
MS-DOS
Intel DX4
CONFIG.SYS
Linux
SSE2
SSE3
instruction set
busy waiting
latency
Sleep (system call)
ring 0
kernel
application programming interface
scheduler
Advanced Configuration and Power Interface
Advanced Power Management
Computer architecture
Halt and Catch Fire
Idle (CPU)
Instruction set architecture

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.