CLI Instruction (Clear Interrupt Flag)

Clears the interrupt disable flag.

CLI Overloads

OpcodeSyntaxAddressing modeBytesCyclesNotes
58CLIImp.12

Flag changes

-----i--

i: Cleared by this instruction.

Explanation

The CLI instruction enables IRQ interrupts by clearing the interrupt disable flag in the status flags.

Examples

Enabling IRQ after initialization

    ; ... set up HTIME, VTIME, NMITIMEN, etc. ...
    CLI             ; accept IRQs from here on

The interrupt disable flag is set right after power-on, so if you use IRQ, execute CLI once your setup is finished.

See also

Flag instructions
CLC Instruction
CLD Instruction
CLV Instruction
REP Instruction
SEP Instruction
SEC Instruction
SED Instruction
SEI Instruction
XCE Instruction

Interrupt instructions
BRK Instruction
COP Instruction
RTI Instruction
WAI Instruction