CLear Interrupts
|
In x86 assembly, CLI is a mnemonic for CLear Interrupts. It sets the interrupt flag (IF) to zero, so that any (maskable) external interrupts are not serviced. An opcode with opposite functionality is STI, which sets IF to one and tells the CPU to service external interrupts. CLI is a privileged instruction, which triggers a general fault if an unprivileged application running in virtual mode attempts to execute it.
Any software interrupts will be serviced irrespective of the value of IF. A software interrupt is one called by the instruction INT xx.
Because the HLT instruction halts until an interrupt occurs, the combination CLI HLT is commonly used to unconditionally hang the computer.