public void Clear() { Teleprinter.Clear(); Registers.AC.Clear(); Interrupts.ClearUser(); Interrupts.Disable(); }
public void FetchAndExecute() { Interrupts.Interrupt(); var instruction = Fetch(Registers.PC.IF_PC); Registers.PC.Increment(); if (Log.IsEnabled(Serilog.Events.LogEventLevel.Debug)) { Log.Debug(instruction.ToString()); } instruction.Execute(); }
public Processor(IMemory memory, IRegisters registers, ITeleprinter teleprinter) { Memory = memory ?? throw new ArgumentNullException(nameof(memory)); Teleprinter = teleprinter ?? throw new ArgumentNullException(nameof(teleprinter)); Registers = registers ?? throw new ArgumentNullException(nameof(registers)); Interrupts = new Interrupts(registers, memory, teleprinter); group1Instructions = new Group1Instructions(this); group3Instructions = new Group3Instructions(this); memoryReferenceInstructions = new MemoryReferenceInstructions(this); noOperationInstruction = new NoOperationInstruction(this); group2ANDInstructions = new Group2ANDInstructions(this); group2ORInstructions = new Group2ORInstructions(this); memoryManagementInstructions = new MemoryManagementInstructions(this); keyboardInstructions = new KeyboardInstructions(this); teleprinterInstructions = new TeleprinterInstructions(this); interruptInstructions = new InterruptInstructions(this); privilegedNoOperationInstruction = new PrivilegedNoOperationInstruction(this); }