BRK (BReaK)¶
Push (PC >> 8); Push (PC & 0xFF); Push (Flags | B); Flags |= I = 1; PC = [IRQ Vector]
BRK performs an interrupt request by pushing the program counter (PC) and processor status (Flags) onto the stack, and then setting the program counter to the address of the interrupt vector. It also sets the Interrupt Disable (I) flag to 1.
Addressing Modes¶
Mode |
Syntax |
Bytes |
Cycles |
|---|---|---|---|
Implied |
BRK |
|
7 |
Flags Affected¶
All flags are affected.
Examples¶
Interrupt Handling¶
; initialize interrupt vector
LDA #<IRQ_HANDLER
STA $FFFE
LDA #>IRQ_HANDLER
STA $FFFF
; enable IRQ interrupts
SEI
See Also¶
RTI (ReTurn from Interrupt)