From 0209e32e98b135a5a689a28e8db06880d29bbedf Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 18 Dec 2023 14:34:08 -0300 Subject: branch opcodes --- opcode_pc.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'opcode_pc.h') diff --git a/opcode_pc.h b/opcode_pc.h index 7a79bbe..0d79aad 100644 --- a/opcode_pc.h +++ b/opcode_pc.h @@ -11,6 +11,14 @@ enum _INSTRUCTION{ INX, AND, ASL, + BCC, + BCS, + BEQ, + BMI, + BNE, + BPL, + BVC, + BVS, }; struct _OPCODE{ @@ -57,7 +65,23 @@ void init_opcode_pc(){ OPCODE[0x06] = (struct _OPCODE){ASL, ZeroPage, 2}; OPCODE[0x16] = (struct _OPCODE){ASL, ZeroPage_X, 2}; OPCODE[0x0E] = (struct _OPCODE){ASL, Absolute, 3}; - OPCODE[0x1E] = (struct _OPCODE){ASL, Absolute_X, 3}; + OPCODE[0x1E] = (struct _OPCODE){ASL, Absolute_X, 3}; + /*BCC*/ + OPCODE[0x90] = (struct _OPCODE){BCC, NoneAddressing, 2}; + /*BCS*/ + OPCODE[0xB0] = (struct _OPCODE){BCS, NoneAddressing, 2}; + /*BEQ*/ + OPCODE[0xF0] = (struct _OPCODE){BEQ, NoneAddressing, 2}; + /*BMI*/ + OPCODE[0x30] = (struct _OPCODE){BMI, NoneAddressing, 2}; + /*BNE*/ + OPCODE[0xD0] = (struct _OPCODE){BNE, NoneAddressing, 2}; + /*BPL*/ + OPCODE[0x10] = (struct _OPCODE){BPL, NoneAddressing, 2}; + /*BVC*/ + OPCODE[0x50] = (struct _OPCODE){BVC, NoneAddressing, 2}; + /*BVS*/ + OPCODE[0x70] = (struct _OPCODE){BVS, NoneAddressing, 2}; } #endif \ No newline at end of file -- cgit v1.2.3