Beispiel #1
0
 public static IEnumerable <MemoryState> GetMemoryState(this IPlottyMachine machine, IDictionary <Reference, int> addressMap)
 {
     return(addressMap.Select((x, i) =>
     {
         var value = machine.Memory[addressMap[x.Key]];
         return new MemoryState(i, x.Key, value);
     }));
 }
Beispiel #2
0
 public int GetValue(IPlottyMachine plottyMachine)
 {
     return(plottyMachine.Memory[GetAddress(plottyMachine)]);
 }
Beispiel #3
0
 public abstract int GetAddress(IPlottyMachine plottyMachine);
Beispiel #4
0
 public ArithmeticCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }
Beispiel #5
0
 public MoveCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }
Beispiel #6
0
 public override int GetValue(IPlottyMachine plottyMachine)
 {
     return(Immediate);
 }
Beispiel #7
0
 public BranchCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }
Beispiel #8
0
 public LoadCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }
Beispiel #9
0
 public HaltCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }
Beispiel #10
0
 public override int GetValue(IPlottyMachine plottyMachine)
 {
     return(plottyMachine.Registers[Register.Id]);
 }
Beispiel #11
0
 public StoreCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }
Beispiel #12
0
 public override int GetAddress(IPlottyMachine plottyMachine)
 {
     return(plottyMachine.Registers[BaseRegister.Id] + Offset.GetValue(plottyMachine));
 }
Beispiel #13
0
 public abstract int GetValue(IPlottyMachine plottyMachine);
Beispiel #14
0
 public Command(IPlottyMachine plottyMachine)
 {
     PlottyMachine = plottyMachine;
 }
Beispiel #15
0
 public NoCommand(IPlottyMachine plottyMachine) : base(plottyMachine)
 {
 }