Created
February 2, 2015 00:24
-
-
Save jacobmischka/c7fcd2a9b67d52d655c8 to your computer and use it in GitHub Desktop.
brk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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