I know this 6502 instruction looks like it'd be a breakpoint, and it is used as such, but it's also used for system calls in some operating systems for 6502 machines.
  • Function: Push flags (OR'd with 0x10 to distinguish BRK from an IRQ) and return address; set B bit of flags; jump to IRQ vector.
  • Updates flags: None
  • Cycles: 7
  • Opcode numbers:
    dp    $00 (7 cycles)

Though BRK is a 2-byte instruction, some assemblers seem to think that BRK is a one-byte instruction. In such a case, write your syscalls like this:

  .dcb syscall_no

See also: 6502 instructions | 6502 addressing modes

Log in or registerto write something here or to contact authors.