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. x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ... A mnemonic (Pronounced in American English, in British English) is a memory aid. ... Microprocessors perform operations using binary bits (on/off/1or0). ...
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.
In x86 assembly, STI is a mnemonic for SeT Interrupts. ... x86 or 80x86 is the generic name of a microprocessor architecture first developed and manufactured by Intel. ...
When there is a switch to protected mode, the dpmi host ignores the normal interrupt vector table used in real mode that lies at address 0000:0000 and sets the 386+ IDT (Interrupt Descriptor Table) register to a vector table somewhere else in memory (and not necessarily at physical address zero).
However, if priorities are shifted during the execution of the interrupt handler or if you're running in the special mask mode (see the section about the 8259A PIC for more information), you should send a specific EOI instead to set the right bit corresponding to the handler.
Interrupts and handlers will keep on confusing programmers for quite some time, mostly because of the debugging difficulty they originate (you can never be too sure where the error occurred).
It clears the interrupt flag (IF) in the EFLAGS register (sets it to zero), which disables all maskable interrupts (but not non-maskable interrupts).
Note that CLI only affects the interrupt flag for the processor on which it is executed; in multiprocessor systems, executing a CLI instruction does not disable interrupts on other processors.
Because the HLT instruction halts until an interrupt occurs, the combination of a CLI followed by a HLT is commonly used to intentionally hang the computer.