#ifndef OPCODES_H #define OPCODES_H /* 0 */ #define BRK 0x00 // Break; #define ORA_XZi 0x01 // OR memory with accumulator, X-indexed zero page indirect #define ORA_Z 0x05 // OR memory with accumulator, zero page #define ASL_Z 0x06 // Arithmetic shift left, zero page #define PHP 0x08 // Push processor status on stack #define ORA_I 0x09 // OR memory with accumulator, immediate #define ASL 0x0a // Arithmetic shift left, accumulator #define ORA_A 0x0d // OR memory with accumulator, absolute #define ASL_A 0x0e // Arithmetic shift left, absolute /* 9 */ #define BPL 0x10 // Branch on result plus #define ORA_ZiY 0x11 // OR memory with accumulator, zero page indirect Y-indexed #define ORA_XZ 0x15 // OR memory with accumulator, X-indexed zero page #define ASL_XZ 0x16 // Arithmetic shift left, X-indexed zero page #define CLC 0x18 // Clear carry flag #define ORA_YA 0x19 // OR memory with accumulator, Y-indexed absolute #define ORA_XA 0x1d // OR memory with accumulator, X-indexed absolute #define ASL_XA 0x1e // Arithmetic shift left, X-indexed absolute /* 17 */ #define JSR 0x20 // Jump to subroutine #define AND_XZi 0x21 // AND memory with accumulator, X-indexed zero page indirect #define BIT_Z 0x24 // Test bist in memory with accumulator, zero page #define AND_Z 0x25 // AND memory with accumulator, zero page #define ROL_Z 0x26 // Rotate left, zero page #define PLP 0x28 // Pull processor status from stack #define AND_I 0x29 // AND memory with accumulator, immediate #define ROL 0x2a // Rotate left, accumulator #define BIT_A 0x2c // Test bist in memory with accumulator, absolute #define AND_A 0x2d // AND memory with accumulator, absolute #define ROL_A 0x2e // Rotate left, absolute /* 28 */ #define BMI 0x30 // Branch on result minus #define AND_ZiY 0x31 // AND memory with accumulator, zero page indirect Y-indexed #define AND_XZ 0x35 // AND memory with accumulator, X-indexed zero page #define ROL_XZ 0x36 // Rotate left, X-indexed zero page #define SEC 0x38 // Set carry flag #define AND_YA 0x39 // AND memory with accumulator, Y-indexed absolute #define AND_XA 0x3d // AND memory with accumulator, X-indexed absolute #define ROL_XA 0x3e // Rotate left, X-indexed absolute /* 36 */ #define RTI 0x40 // Return from interrupt #define EOR_XZi 0x41 // XOR with accumulator, X-indexed zero page indirect #define EOR_Z 0x45 // XOR with accumulator, zero page #define LSR_Z 0x46 // Logical shift right, zero page #define PHA 0x48 // Push accumulator on stack #define EOR_I 0x49 // XOR with accumulator, immediate #define LSR 0x4a // Logical shift right, accumulator #define JMP_A 0x4c // Jump indirect, absolute #define EOR_A 0x4d // XOR with accumulator, absolute #define LSR_A 0x4e // Logical shift right, absolute /* 46 */ #define BVC 0x50 // Branch on overflow clear #define EOR_ZiY 0x51 // XOR with accumulator, zero page indirect Y-indexed #define EOR_XZ 0x55 // XOR with accumulator, X-indexed zero page #define LSR_XZ 0x56 // Logical shift right, X-indexed zero page #define CLI 0x58 // Clear interrupt disable #define EOR_YA 0x59 // XOR with accumulator, Y-indexed absolute #define EOR_XA 0x5d // XOR with accumulator, X-indexed absolute #define LSR_XA 0x5e // Logical shift right, X-indexed absolute /* 54 */ #define RTS 0x60 // Return from subroutine #define ADC_XZi 0x61 // Add memory to accumulator with carry, X-indexed zero page indirect #define ADC_Z 0x65 // Add memory to accumulator with carry, zero page #define ROR_Z 0x66 // Rotate right, zero page #define PLA 0x68 // Pull accumulator from stack #define ADC_I 0x69 // Add memory to accumulator with carry, immediate #define ROR 0x6a // Rotate right, accumulator #define JMP_Ai 0x6c // Jump indirect, absolute indirect #define ADC_A 0x6d // Add memory to accumulator with carry, absolute #define ROR_A 0x6e // Rotate right, absolute /* 64 */ #define BVS 0x70 // Branch on overflow set #define ADC_ZiY 0x71 // Add memory to accumulator with carry, zero page indirect Y-indexed #define ADC_XZ 0x75 // Add memory to accumulator with carry, X-indexed zero page #define ROR_XZ 0x76 // Rotate right, X-indexed zero page #define SEI 0x78 // Set Interrupt Disable #define ADC_YA 0x79 // Add memory to accumulator with carry, Y-indexed absolute #define ADC_XA 0x7d // Add memory to accumulator with carry, X-indexed absolute #define ROR_XA 0x7e // Rotate right, X-indexed absolute /* 72 */ #define STA_XZi 0x81 // Store accumulator in memory, X-indexed zero page indirect #define STY_Z 0x84 // Store Y in memory, zero page #define STA_Z 0x85 // Store accumulator in memory, zero page #define STX_Z 0x86 // Store X in memory, zero page #define DEY 0x88 // Decrement Y by one #define TXA 0x8a // Transfer X to accumulator #define STY_A 0x8c // Store Y in memory, absolute #define STA_A 0x8d // Store accumulator in memory, absolute #define STX_A 0x8e // Store X in memory, absolute /* 81 */ #define BCC 0x90 // Branch on carry clear #define STA_ZiY 0x91 // Store accumulator in memory, zero page indirect Y-indexed #define STY_XZ 0x94 // Store Y in memory, X-indexed zero page #define STA_XZ 0x95 // Store accumulator in memory, X-indexed zero page #define STX_YZ 0x96 // Store X in memory, Y-indexed zero page #define TYA 0x98 // Transfer Y to accumulator #define STA_YA 0x99 // Store accumulator to memory, Y-indexed absolute #define TXS 0x9a // Transfer X to stack pointer #define STA_XA 0x9d // Store accumulator to memory, X-indexed absolute /* 90 */ #define LDY_I 0xa0 // Load Y from memory, immediate #define LDA_XZi 0xa1 // Load accumulator from memory, X-indexed zero page indirect #define LDX_I 0xa2 // Load X from memory, immediate #define LDY_Z 0xa4 // Load Y from memory, zero page #define LDA_Z 0xa5 // Load accumulator from memory, zero page #define LDX_Z 0xa6 // Load X from memory, zero page #define TAY 0xa8 // Transfer accumulator to Y #define LDA_I 0xa9 // Load accumulator from memory, immediate #define TAX 0xaa // Transfer accumulator to X #define LDY_A 0xac // Load Y from memory, absolute #define LDA_A 0xad // Load accumulator from memory, absolute #define LDX_A 0xae // Load X from memory, absolute /* 102 */ #define BCS 0xb0 // Branch on carry set #define LDA_ZiY 0xb1 // Load accumulator from memory, zero page indirect Y-indexed #define LDY_XZ 0xb4 // Load Y from memory, X-indexed zero page #define LDA_XZ 0xb5 // Load A from memory, X-indexed zero page #define LDX_YZ 0xb6 // Load X from memory, Y-indexed zero page #define CLV 0xb8 // Clear overflow flag #define LDA_YA 0xb9 // Load A from memory, Y-indexed absolute #define TSX 0xba // Transfer stack pointer to X #define LDY_XA 0xbc // Load Y from memory, X-indexed absolute #define LDA_XA 0xbd // Load A from memory, X-indexed absolute #define LDX_YA 0xbe // Load X from memory, Y-indexed absolute /* 113 */ #define CPY_I 0xc0 // Compare Y to memory, immediate #define CMP_XZi 0xc1 // Compare accumulator to memory, X-indexed zero page indirect #define CPY_Z 0xc4 // Compare Y to memory, zero page #define CMP_Z 0xc5 // Compare accumulator to memory, zero page #define DEC_Z 0xc6 // Decrement memory by one, zero page #define INY 0xc8 // Increment Y by one #define CMP_I 0xc9 // Compare accumulator to memory, immediate #define DEX 0xca // Decrement X by one #define CPY_A 0xcc // Compare Y to memory, absolute #define CMP_A 0xcd // Compare accumulator to memory, absolute #define DEC_A 0xce // Decrement memory by one, absolute /* 124 */ #define BNE 0xd0 // Branch on result not zero #define CMP_ZiY 0xd1 // Compare accumulator to memory, zero page indirect Y-indexed #define CMP_XZ 0xd5 // Compare accumulator to memory, X-indexed zero page #define DEC_XZ 0xd6 // Decrement memory by one, X-indexed zero page #define CLD 0xd8 // Clear decimal mode #define CMP_YA 0xd9 // Compare accumulator to memory, Y-indexed absolute #define CMP_XA 0xdd // Compare accumulator to memory, X-indexed absolute #define DEC_XA 0xde // Decrement memory by one, X-indexed absolute /* 132 */ #define CPX_I 0xe0 // Compare X to memory, immediate #define SBC_XZi 0xe1 // Subtract memory from accumulator with borrow, X-indexed zero page indirect #define CPX_Z 0xe4 // Compare X to memory, zero page #define SBC_Z 0xe5 // Subtract memory from accumulator with borrow, zero page #define INC_Z 0xe6 // Increment memory by one, zero page #define INX 0xe8 // Increment X by one #define SBC_I 0xe9 // Subtract memory from accumulator with borrow, immediate #define NOP 0xea // No operation #define CPX_A 0xec // Compare X to memory, absolute #define SBC_A 0xed // Subtract memory from accumulator with borrow, absolute #define INC_A 0xee // Increment memory by one, absolute /* 143 */ #define BEQ 0xf0 // Branch on result zero #define SBC_ZiY 0xf1 // Subtract memory from accumulator with borrow, zero page indirect Y-indexed #define SBC_XZ 0xf5 // Subtract memory from accumulator with borrow, X-indexed zero page #define INC_XZ 0xf6 // Increment memory by one, X-indexed zero page #define SED 0xf8 // Set decimal mode #define SBC_YA 0xf9 // Subtract memory from accumulator with borrow, Y-indexed absolute #define SBC_XA 0xfd // Subtract memory from accumulator with borrow, X-indexed absolute #define INC_XA 0xfe // Increment memory by one, X-indexed absolute /* 151 */ #endif // OPCODES_H