Skip to content

Instantly share code, notes, and snippets.

@jacobmischka
Created February 2, 2015 00:24
Show Gist options
  • Save jacobmischka/c7fcd2a9b67d52d655c8 to your computer and use it in GitHub Desktop.
Save jacobmischka/c7fcd2a9b67d52d655c8 to your computer and use it in GitHub Desktop.
brk
/* Force break */
/* I=1 */
static void BRK() {
cpu.PC++;
pushw(cpu.PC);
pushb(cpu.S);
SET_FLAG(FLAG_I);
if(NMI){
cpu.PC = Memory_ReadWord(0xFFFA);
}
else{
if(!IRQ)
SET_FLAG(FLAG_B);
cpu.PC = Memory_ReadWord(0xFFFE);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment