From 312f231d5d3b4523a5763eb01981885d0a66b8cd Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 20 Nov 2023 13:23:48 -0300 Subject: and, asl, enable/disable flags --- opcode_pc.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'opcode_pc.h') diff --git a/opcode_pc.h b/opcode_pc.h index 8a95db8..7a79bbe 100644 --- a/opcode_pc.h +++ b/opcode_pc.h @@ -9,12 +9,14 @@ enum _INSTRUCTION{ BRK, STA, INX, + AND, + ASL, }; struct _OPCODE{ enum _INSTRUCTION instruction; enum adressing_mode mode; - int bytes; + uint8_t bytes; }OPCODE[0xFF]; void init_opcode_pc(){ @@ -41,6 +43,21 @@ void init_opcode_pc(){ OPCODE[0x91] = (struct _OPCODE){STA, Indirect_Y, 2}; /*INX*/ OPCODE[0xE8] = (struct _OPCODE){INX, NoneAddressing, 1}; + /*AND*/ + OPCODE[0x29] = (struct _OPCODE){AND, Immediate, 2}; + OPCODE[0x25] = (struct _OPCODE){AND, ZeroPage, 2}; + OPCODE[0x35] = (struct _OPCODE){AND, ZeroPage_X, 2}; + OPCODE[0x2D] = (struct _OPCODE){AND, Absolute, 3}; + OPCODE[0x3D] = (struct _OPCODE){AND, Absolute_X, 3}; + OPCODE[0x39] = (struct _OPCODE){AND, Absolute_Y, 3}; + OPCODE[0x21] = (struct _OPCODE){AND, Indirect_X, 2}; + OPCODE[0x31] = (struct _OPCODE){AND, Indirect_Y, 2}; + /*ASL*/ + OPCODE[0x0A] = (struct _OPCODE){ASL, NoneAddressing, 1}; + 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}; } #endif \ No newline at end of file -- cgit v1.2.3