using System;
using System.Collections.Generic;

using System.Text;
using System.Threading.Tasks;

namespace FoenixIDE.Processor
{
    public class OpcodeList : List<OpCode>
    {
        #region constants

        public const int PUSH2 = 16;
        public const int ADD1_16BIT = 32;

        public const int BRK_Interrupt = 0x00;
        public const int ORA_DirectPageIndexedIndirectWithX = 0x01;
        public const int COP_Interrupt = 0x02;
        public const int ORA_StackRelative = 0x03;
        public const int TSB_DirectPage = 0x04;
        public const int ORA_DirectPage = 0x05;
        public const int ASL_DirectPage = 0x06;
        public const int ORA_DirectPageIndirectLong = 0x07;
        public const int PHP_StackImplied = 0x08;
        public const int ORA_Immediate = 0x09;
        public const int ASL_Accumulator = 0x0A;
        public const int PHD_StackImplied = 0x0B;
        public const int TSB_Absolute = 0x0C;
        public const int ORA_Absolute = 0x0D;
        public const int ASL_Absolute = 0x0E;
        public const int ORA_AbsoluteLong = 0x0F;
        public const int BPL_ProgramCounterRelative = 0x10;
        public const int ORA_DirectPageIndirectIndexedWithY = 0x11;
        public const int ORA_DirectPageIndirect = 0x12;
        public const int ORA_StackRelativeIndirectIndexedWithY = 0x13;
        public const int TRB_DirectPage = 0x14;
        public const int ORA_DirectPageIndexedWithX = 0x15;
        public const int ASL_DirectPageIndexedWithX = 0x16;
        public const int ORA_DirectPageIndirectLongIndexedWithY = 0x17;
        public const int CLC_Implied = 0x18;
        public const int ORA_AbsoluteIndexedWithY = 0x19;
        public const int INC_Accumulator = 0x1A;
        public const int TCS_Implied = 0x1B;
        public const int TRB_Absolute = 0x1C;
        public const int ORA_AbsoluteIndexedWithX = 0x1D;
        public const int ASL_AbsoluteIndexedWithX = 0x1E;
        public const int ORA_AbsoluteLongIndexedWithX = 0x1F;
        public const int JSR_Absolute = 0x20;
        public const int AND_DirectPageIndexedIndirectWithX = 0x21;
        public const int JSR_AbsoluteLong = 0x22;
        public const int AND_StackRelative = 0x23;
        public const int BIT_DirectPage = 0x24;
        public const int AND_DirectPage = 0x25;
        public const int ROL_DirectPage = 0x26;
        public const int AND_DirectPageIndirectLong = 0x27;
        public const int PLP_StackImplied = 0x28;
        public const int AND_Immediate = 0x29;
        public const int ROL_Accumulator = 0x2A;
        public const int PLD_StackImplied = 0x2B;
        public const int BIT_Absolute = 0x2C;
        public const int AND_Absolute = 0x2D;
        public const int ROL_Absolute = 0x2E;
        public const int AND_AbsoluteLong = 0x2F;
        public const int BMI_ProgramCounterRelative = 0x30;
        public const int AND_DirectPageIndirectIndexedWithY = 0x31;
        public const int AND_DirectPageIndirect = 0x32;
        public const int AND_StackRelativeIndirectIndexedWithY = 0x33;
        public const int BIT_DirectPageIndexedWithX = 0x34;
        public const int AND_DirectPageIndexedWithX = 0x35;
        public const int ROL_DirectPageIndexedWithX = 0x36;
        public const int AND_DirectPageIndirectLongIndexedWithY = 0x37;
        public const int SEC_Implied = 0x38;
        public const int AND_AbsoluteIndexedWithY = 0x39;
        public const int DEC_Accumulator = 0x3A;
        public const int TSC_Implied = 0x3B;
        public const int BIT_AbsoluteIndexedWithX = 0x3C;
        public const int AND_AbsoluteIndexedWithX = 0x3D;
        public const int ROL_AbsoluteIndexedWithX = 0x3E;
        public const int AND_AbsoluteLongIndexedWithX = 0x3F;
        public const int RTI_StackImplied = 0x40;
        public const int EOR_DirectPageIndexedIndirectWithX = 0x41;
        public const int WDM_Implied = 0x42;
        public const int EOR_StackRelative = 0x43;
        public const int MVP_BlockMove = 0x44;
        public const int EOR_DirectPage = 0x45;
        public const int LSR_DirectPage = 0x46;
        public const int EOR_DirectPageIndirectLong = 0x47;
        public const int PHA_StackImplied = 0x48;
        public const int EOR_Immediate = 0x49;
        public const int LSR_Accumulator = 0x4A;
        public const int PHK_StackImplied = 0x4B;
        public const int JMP_Absolute = 0x4C;
        public const int EOR_Absolute = 0x4D;
        public const int LSR_Absolute = 0x4E;
        public const int EOR_AbsoluteLong = 0x4F;
        public const int BVC_ProgramCounterRelative = 0x50;
        public const int EOR_DirectPageIndirectIndexedWithY = 0x51;
        public const int EOR_DirectPageIndirect = 0x52;
        public const int EOR_StackRelativeIndirectIndexedWithY = 0x53;
        public const int MVN_BlockMove = 0x54;
        public const int EOR_DirectPageIndexedWithX = 0x55;
        public const int LSR_DirectPageIndexedWithX = 0x56;
        public const int EOR_DirectPageIndirectLongIndexedWithY = 0x57;
        public const int CLI_Implied = 0x58;
        public const int EOR_AbsoluteIndexedWithY = 0x59;
        public const int PHY_StackImplied = 0x5A;
        public const int TCD_Implied = 0x5B;
        public const int JMP_AbsoluteLong = 0x5C;
        public const int EOR_AbsoluteIndexedWithX = 0x5D;
        public const int LSR_AbsoluteIndexedWithX = 0x5E;
        public const int EOR_AbsoluteLongIndexedWithX = 0x5F;
        public const int RTS_StackImplied = 0x60;
        public const int ADC_DirectPageIndexedIndirectWithX = 0x61;
        public const int PER_StackProgramCounterRelativeLong = 0x62;
        public const int ADC_StackRelative = 0x63;
        public const int STZ_DirectPage = 0x64;
        public const int ADC_DirectPage = 0x65;
        public const int ROR_DirectPage = 0x66;
        public const int ADC_DirectPageIndirectLong = 0x67;
        public const int PLA_StackImplied = 0x68;
        public const int ADC_Immediate = 0x69;
        public const int ROR_Accumulator = 0x6A;
        public const int RTL_StackImplied = 0x6B;
        public const int JMP_AbsoluteIndirect = 0x6C;
        public const int ADC_Absolute = 0x6D;
        public const int ROR_Absolute = 0x6E;
        public const int ADC_AbsoluteLong = 0x6F;
        public const int BVS_ProgramCounterRelative = 0x70;
        public const int ADC_DirectPageIndirectIndexedWithY = 0x71;
        public const int ADC_DirectPageIndirect = 0x72;
        public const int ADC_StackRelativeIndirectIndexedWithY = 0x73;
        public const int STZ_DirectPageIndexedWithX = 0x74;
        public const int ADC_DirectPageIndexedWithX = 0x75;
        public const int ROR_DirectPageIndexedWithX = 0x76;
        public const int ADC_DirectPageIndirectLongIndexedWithY = 0x77;
        public const int SEI_Implied = 0x78;
        public const int ADC_AbsoluteIndexedWithY = 0x79;
        public const int PLY_StackImplied = 0x7A;
        public const int TDC_Implied = 0x7B;
        public const int JMP_AbsoluteIndexedIndirectWithX = 0x7C;
        public const int ADC_AbsoluteIndexedWithX = 0x7D;
        public const int ROR_AbsoluteIndexedWithX = 0x7E;
        public const int ADC_AbsoluteLongIndexedWithX = 0x7F;
        public const int BRA_ProgramCounterRelative = 0x80;
        public const int STA_DirectPageIndexedIndirectWithX = 0x81;
        public const int BRL_ProgramCounterRelativeLong = 0x82;
        public const int STA_StackRelative = 0x83;
        public const int STY_DirectPage = 0x84;
        public const int STA_DirectPage = 0x85;
        public const int STX_DirectPage = 0x86;
        public const int STA_DirectPageIndirectLong = 0x87;
        public const int DEY_Implied = 0x88;
        public const int BIT_Immediate = 0x89;
        public const int TXA_Implied = 0x8A;
        public const int PHB_StackImplied = 0x8B;
        public const int STY_Absolute = 0x8C;
        public const int STA_Absolute = 0x8D;
        public const int STX_Absolute = 0x8E;
        public const int STA_AbsoluteLong = 0x8F;
        public const int BCC_ProgramCounterRelative = 0x90;
        public const int STA_DirectPageIndirectIndexedWithY = 0x91;
        public const int STA_DirectPageIndirect = 0x92;
        public const int STA_StackRelativeIndirectIndexedWithY = 0x93;
        public const int STY_DirectPageIndexedWithX = 0x94;
        public const int STA_DirectPageIndexedWithX = 0x95;
        public const int STX_DirectPageIndexedWithY = 0x96;
        public const int STA_DirectPageIndirectLongIndexedWithY = 0x97;
        public const int TYA_Implied = 0x98;
        public const int STA_AbsoluteIndexedWithY = 0x99;
        public const int TXS_Implied = 0x9A;
        public const int TXY_Implied = 0x9B;
        public const int STZ_Absolute = 0x9C;
        public const int STA_AbsoluteIndexedWithX = 0x9D;
        public const int STZ_AbsoluteIndexedWithX = 0x9E;
        public const int STA_AbsoluteLongIndexedWithX = 0x9F;
        public const int LDY_Immediate = 0xA0;
        public const int LDA_DirectPageIndexedIndirectWithX = 0xA1;
        public const int LDX_Immediate = 0xA2;
        public const int LDA_StackRelative = 0xA3;
        public const int LDY_DirectPage = 0xA4;
        public const int LDA_DirectPage = 0xA5;
        public const int LDX_DirectPage = 0xA6;
        public const int LDA_DirectPageIndirectLong = 0xA7;
        public const int TAY_Implied = 0xA8;
        public const int LDA_Immediate = 0xA9;
        public const int TAX_Implied = 0xAA;
        public const int PLB_StackImplied = 0xAB;
        public const int LDY_Absolute = 0xAC;
        public const int LDA_Absolute = 0xAD;
        public const int LDX_Absolute = 0xAE;
        public const int LDA_AbsoluteLong = 0xAF;
        public const int BCS_ProgramCounterRelative = 0xB0;
        public const int LDA_DirectPageIndirectIndexedWithY = 0xB1;
        public const int LDA_DirectPageIndirect = 0xB2;
        public const int LDA_StackRelativeIndirectIndexedWithY = 0xB3;
        public const int LDY_DirectPageIndexedWithX = 0xB4;
        public const int LDA_DirectPageIndexedWithX = 0xB5;
        public const int LDX_DirectPageIndexedWithY = 0xB6;
        public const int LDA_DirectPageIndirectLongIndexedWithY = 0xB7;
        public const int CLV_Implied = 0xB8;
        public const int LDA_AbsoluteIndexedWithY = 0xB9;
        public const int TSX_Implied = 0xBA;
        public const int TYX_Implied = 0xBB;
        public const int LDY_AbsoluteIndexedWithX = 0xBC;
        public const int LDA_AbsoluteIndexedWithX = 0xBD;
        public const int LDX_AbsoluteIndexedWithY = 0xBE;
        public const int LDA_AbsoluteLongIndexedWithX = 0xBF;
        public const int CPY_Immediate = 0xC0;
        public const int CMP_DirectPageIndexedIndirectWithX = 0xC1;
        public const int REP_Immediate = 0xC2;
        public const int CMP_StackRelative = 0xC3;
        public const int CPY_DirectPage = 0xC4;
        public const int CMP_DirectPage = 0xC5;
        public const int DEC_DirectPage = 0xC6;
        public const int CMP_DirectPageIndirectLong = 0xC7;
        public const int INY_Implied = 0xC8;
        public const int CMP_Immediate = 0xC9;
        public const int DEX_Implied = 0xCA;
        public const int WAI_Implied = 0xCB;
        public const int CPY_Absolute = 0xCC;
        public const int CMP_Absolute = 0xCD;
        public const int DEC_Absolute = 0xCE;
        public const int CMP_AbsoluteLong = 0xCF;
        public const int BNE_ProgramCounterRelative = 0xD0;
        public const int CMP_DirectPageIndirectIndexedWithY = 0xD1;
        public const int CMP_DirectPageIndirect = 0xD2;
        public const int CMP_StackRelativeIndirectIndexedWithY = 0xD3;
        public const int PEI_StackDirectPageIndirect = 0xD4;
        public const int CMP_DirectPageIndexedWithX = 0xD5;
        public const int DEC_DirectPageIndexedWithX = 0xD6;
        public const int CMP_DirectPageIndirectLongIndexedWithY = 0xD7;
        public const int CLD_Implied = 0xD8;
        public const int CMP_AbsoluteIndexedWithY = 0xD9;
        public const int PHX_StackImplied = 0xDA;
        public const int STP_Implied = 0xDB;
        public const int JMP_AbsoluteIndirectLong = 0xDC;
        public const int CMP_AbsoluteIndexedWithX = 0xDD;
        public const int DEC_AbsoluteIndexedWithX = 0xDE;
        public const int CMP_AbsoluteLongIndexedWithX = 0xDF;
        public const int CPX_Immediate = 0xE0;
        public const int SBC_DirectPageIndexedIndirectWithX = 0xE1;
        public const int SEP_Immediate = 0xE2;
        public const int SBC_StackRelative = 0xE3;
        public const int CPX_DirectPage = 0xE4;
        public const int SBC_DirectPage = 0xE5;
        public const int INC_DirectPage = 0xE6;
        public const int SBC_DirectPageIndirectLong = 0xE7;
        public const int INX_Implied = 0xE8;
        public const int SBC_Immediate = 0xE9;
        public const int NOP_Implied = 0xEA;
        public const int XBA_Implied = 0xEB;
        public const int CPX_Absolute = 0xEC;
        public const int SBC_Absolute = 0xED;
        public const int INC_Absolute = 0xEE;
        public const int SBC_AbsoluteLong = 0xEF;
        public const int BEQ_ProgramCounterRelative = 0xF0;
        public const int SBC_DirectPageIndirectIndexedWithY = 0xF1;
        public const int SBC_DirectPageIndirect = 0xF2;
        public const int SBC_StackRelativeIndirectIndexedWithY = 0xF3;
        public const int PEA_StackAbsolute = 0xF4;
        public const int SBC_DirectPageIndexedWithX = 0xF5;
        public const int INC_DirectPageIndexedWithX = 0xF6;
        public const int SBC_DirectPageIndirectLongIndexedWithY = 0xF7;
        public const int SED_Implied = 0xF8;
        public const int SBC_AbsoluteIndexedWithY = 0xF9;
        public const int PLX_StackImplied = 0xFA;
        public const int XCE_Implied = 0xFB;
        public const int JSR_AbsoluteIndexedIndirectWithX = 0xFC;
        public const int SBC_AbsoluteIndexedWithX = 0xFD;
        public const int INC_AbsoluteIndexedWithX = 0xFE;
        public const int SBC_AbsoluteLongIndexedWithX = 0xFF;

        #endregion constants
        
        public OpcodeList(Operations operations, CPU CPU)
        {
            Add(new OpCode(0x00, "BRK", 2, AddressModes.Interrupt, new OpCode.ExecuteDelegate(operations.ExecuteInterrupt)));
            Add(new OpCode(0x01, "ORA", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x02, "COP", 2, AddressModes.Interrupt, new OpCode.ExecuteDelegate(operations.ExecuteInterrupt)));
            Add(new OpCode(0x03, "ORA", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x04, "TSB", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteTSBTRB)));
            Add(new OpCode(0x05, "ORA", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x06, "ASL", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x07, "ORA", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x08, "PHP", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x09, "ORA", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x0A, "ASL", 1, AddressModes.Accumulator, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x0B, "PHD", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x0C, "TSB", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteTSBTRB)));
            Add(new OpCode(0x0D, "ORA", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x0E, "ASL", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x0F, "ORA", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x10, "BPL", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x11, "ORA", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x12, "ORA", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x13, "ORA", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x14, "TRB", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteTSBTRB)));
            Add(new OpCode(0x15, "ORA", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x16, "ASL", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x17, "ORA", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x18, "CLC", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0x19, "ORA", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x1A, "INC", 1, AddressModes.Accumulator, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0x1B, "TCS", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x1C, "TRB", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteTSBTRB)));
            Add(new OpCode(0x1D, "ORA", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x1E, "ASL", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x1F, "ORA", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteORA)));
            Add(new OpCode(0x20, "JSR", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x21, "AND", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x22, "JSR", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x23, "AND", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x24, "BIT", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteBIT)));
            Add(new OpCode(0x25, "AND", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x26, "ROL", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x27, "AND", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x28, "PLP", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x29, "AND", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x2A, "ROL", 1, AddressModes.Accumulator, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x2B, "PLD", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x2C, "BIT", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteBIT)));
            Add(new OpCode(0x2D, "AND", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x2E, "ROL", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x2F, "AND", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x30, "BMI", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x31, "AND", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x32, "AND", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x33, "AND", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x34, "BIT", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteBIT)));
            Add(new OpCode(0x35, "AND", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x36, "ROL", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x37, "AND", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x38, "SEC", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0x39, "AND", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x3A, "DEC", 1, AddressModes.Accumulator, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0x3B, "TSC", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x3C, "BIT", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteBIT)));
            Add(new OpCode(0x3D, "AND", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x3E, "ROL", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x3F, "AND", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteAND)));
            Add(new OpCode(0x40, "RTI", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x41, "EOR", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x42, "WDM", 2, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteMisc)));
            Add(new OpCode(0x43, "EOR", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x44, "MVP", 3, AddressModes.BlockMove, new OpCode.ExecuteDelegate(operations.ExecuteBlockMove)));
            Add(new OpCode(0x45, "EOR", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x46, "LSR", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x47, "EOR", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x48, "PHA", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x49, "EOR", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x4A, "LSR", 1, AddressModes.Accumulator, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x4B, "PHK", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x4C, "JMP", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x4D, "EOR", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x4E, "LSR", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x4F, "EOR", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x50, "BVC", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x51, "EOR", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x52, "EOR", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x53, "EOR", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x54, "MVN", 3, AddressModes.BlockMove, new OpCode.ExecuteDelegate(operations.ExecuteBlockMove)));
            Add(new OpCode(0x55, "EOR", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x56, "LSR", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x57, "EOR", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x58, "CLI", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0x59, "EOR", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x5A, "PHY", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x5B, "TCD", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x5C, "JMP", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x5D, "EOR", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x5E, "LSR", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x5F, "EOR", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteEOR)));
            Add(new OpCode(0x60, "RTS", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x61, "ADC", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x62, "PER", 3, AddressModes.StackProgramCounterRelativeLong, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x63, "ADC", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x64, "STZ", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteSTZ)));
            Add(new OpCode(0x65, "ADC", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x66, "ROR", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x67, "ADC", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x68, "PLA", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x69, "ADC", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x6A, "ROR", 1, AddressModes.Accumulator, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x6B, "RTL", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x6C, "JMP", 3, AddressModes.JmpAbsoluteIndirect, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x6D, "ADC", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x6E, "ROR", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x6F, "ADC", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x70, "BVS", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x71, "ADC", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x72, "ADC", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x73, "ADC", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x74, "STZ", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTZ)));
            Add(new OpCode(0x75, "ADC", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x76, "ROR", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x77, "ADC", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x78, "SEI", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0x79, "ADC", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x7A, "PLY", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x7B, "TDC", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x7C, "JMP", 3, AddressModes.JmpAbsoluteIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0x7D, "ADC", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x7E, "ROR", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteShift)));
            Add(new OpCode(0x7F, "ADC", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteADC)));
            Add(new OpCode(0x80, "BRA", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x81, "STA", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x82, "BRL", 3, AddressModes.ProgramCounterRelativeLong, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x83, "STA", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x84, "STY", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteSTY)));
            Add(new OpCode(0x85, "STA", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x86, "STX", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteSTX)));
            Add(new OpCode(0x87, "STA", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x88, "DEY", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0x89, "BIT", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteBIT)));
            Add(new OpCode(0x8A, "TXA", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x8B, "PHB", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0x8C, "STY", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteSTY)));
            Add(new OpCode(0x8D, "STA", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x8E, "STX", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteSTX)));
            Add(new OpCode(0x8F, "STA", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x90, "BCC", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0x91, "STA", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x92, "STA", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x93, "STA", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x94, "STY", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTY)));
            Add(new OpCode(0x95, "STA", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x96, "STX", 2, AddressModes.DirectPageIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSTX)));
            Add(new OpCode(0x97, "STA", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x98, "TYA", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x99, "STA", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x9A, "TXS", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x9B, "TXY", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0x9C, "STZ", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteSTZ)));
            Add(new OpCode(0x9D, "STA", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0x9E, "STZ", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTZ)));
            Add(new OpCode(0x9F, "STA", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSTA)));
            Add(new OpCode(0xA0, "LDY", 2, CPU.Y, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteLDY)));
            Add(new OpCode(0xA1, "LDA", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xA2, "LDX", 2, CPU.X, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteLDX)));
            Add(new OpCode(0xA3, "LDA", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xA4, "LDY", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteLDY)));
            Add(new OpCode(0xA5, "LDA", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xA6, "LDX", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteLDX)));
            Add(new OpCode(0xA7, "LDA", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xA8, "TAY", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0xA9, "LDA", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xAA, "TAX", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0xAB, "PLB", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0xAC, "LDY", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteLDY)));
            Add(new OpCode(0xAD, "LDA", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xAE, "LDX", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteLDX)));
            Add(new OpCode(0xAF, "LDA", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xB0, "BCS", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0xB1, "LDA", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xB2, "LDA", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xB3, "LDA", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xB4, "LDY", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteLDY)));
            Add(new OpCode(0xB5, "LDA", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xB6, "LDX", 2, AddressModes.DirectPageIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteLDX)));
            Add(new OpCode(0xB7, "LDA", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xB8, "CLV", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0xB9, "LDA", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xBA, "TSX", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0xBB, "TYX", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteTransfer)));
            Add(new OpCode(0xBC, "LDY", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteLDY)));
            Add(new OpCode(0xBD, "LDA", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xBE, "LDX", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteLDX)));
            Add(new OpCode(0xBF, "LDA", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteLDA)));
            Add(new OpCode(0xC0, "CPY", 2, CPU.Y, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteCPY)));
            Add(new OpCode(0xC1, "CMP", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xC2, "REP", 2, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0xC3, "CMP", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xC4, "CPY", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteCPY)));
            Add(new OpCode(0xC5, "CMP", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xC6, "DEC", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xC7, "CMP", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xC8, "INY", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xC9, "CMP", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xCA, "DEX", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xCB, "WAI", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteWAI)));
            Add(new OpCode(0xCC, "CPY", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteCPY)));
            Add(new OpCode(0xCD, "CMP", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xCE, "DEC", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xCF, "CMP", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xD0, "BNE", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0xD1, "CMP", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xD2, "CMP", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xD3, "CMP", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xD4, "PEI", 2, AddressModes.StackDirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0xD5, "CMP", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xD6, "DEC", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xD7, "CMP", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xD8, "CLD", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0xD9, "CMP", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xDA, "PHX", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0xDB, "STP", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteMisc)));
            Add(new OpCode(0xDC, "JMP", 3, AddressModes.JmpAbsoluteIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0xDD, "CMP", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xDE, "DEC", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xDF, "CMP", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteCMP)));
            Add(new OpCode(0xE0, "CPX", 2, CPU.X, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteCPX)));
            Add(new OpCode(0xE1, "SBC", 2, AddressModes.DirectPageIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xE2, "SEP", 2, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0xE3, "SBC", 2, AddressModes.StackRelative, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xE4, "CPX", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteCPX)));
            Add(new OpCode(0xE5, "SBC", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xE6, "INC", 2, AddressModes.DirectPage, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xE7, "SBC", 2, AddressModes.DirectPageIndirectLong, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xE8, "INX", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xE9, "SBC", 2, CPU.A, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xEA, "NOP", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteMisc)));
            Add(new OpCode(0xEB, "XBA", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteMisc)));
            Add(new OpCode(0xEC, "CPX", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteCPX)));
            Add(new OpCode(0xED, "SBC", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xEE, "INC", 3, AddressModes.Absolute, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xEF, "SBC", 4, AddressModes.AbsoluteLong, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xF0, "BEQ", 2, AddressModes.ProgramCounterRelative, new OpCode.ExecuteDelegate(operations.ExecuteBranch)));
            Add(new OpCode(0xF1, "SBC", 2, AddressModes.DirectPageIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xF2, "SBC", 2, AddressModes.DirectPageIndirect, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xF3, "SBC", 2, AddressModes.StackRelativeIndirectIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xF4, "PEA", 3, AddressModes.Immediate, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0xF5, "SBC", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xF6, "INC", 2, AddressModes.DirectPageIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xF7, "SBC", 2, AddressModes.DirectPageIndirectLongIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xF8, "SED", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0xF9, "SBC", 3, AddressModes.AbsoluteIndexedWithY, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xFA, "PLX", 1, AddressModes.StackImplied, new OpCode.ExecuteDelegate(operations.ExecuteStack)));
            Add(new OpCode(0xFB, "XCE", 1, AddressModes.Implied, new OpCode.ExecuteDelegate(operations.ExecuteStatusReg)));
            Add(new OpCode(0xFC, "JSR", 3, AddressModes.JmpAbsoluteIndexedIndirectWithX, new OpCode.ExecuteDelegate(operations.ExecuteJumpReturn)));
            Add(new OpCode(0xFD, "SBC", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
            Add(new OpCode(0xFE, "INC", 3, AddressModes.AbsoluteIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteINCDEC)));
            Add(new OpCode(0xFF, "SBC", 4, AddressModes.AbsoluteLongIndexedWithX, new OpCode.ExecuteDelegate(operations.ExecuteSBC)));
        }
    }
}
