public BasicCpu(IMemory memory, ICpuInstructionExecutor instructionExector) { SetupRegisters(); _memory = memory; _instructionExector = instructionExector; _instructionExector.Cpu = this; _interruptTable = new Dictionary<byte, Action>(); }
public MOS6502Cpu( ILogger <MOS6502Cpu> logger, ICpuInstructionExecutor executor, IMemoryAddressingModes addressingModes, IInstructionLookupTable instructionsTable) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _executor = executor ?? throw new ArgumentNullException(nameof(executor)); _addressingModes = addressingModes ?? throw new ArgumentNullException(nameof(addressingModes)); _instructionsTable = instructionsTable ?? throw new ArgumentNullException(nameof(instructionsTable)); }
public MOS6502InstructionLookupTable( ICpuInstructionExecutor executor, IMemoryAddressingModes addressingModes, ILogger <MOS6502InstructionLookupTable> logger) { _executor = executor ?? throw new ArgumentNullException(nameof(executor)); _addressingModes = addressingModes ?? throw new ArgumentNullException(nameof(addressingModes)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _instructions = new List <CpuInstruction>(); FillInstructionsList(); }