static void Main(string[] args) { List<ushort> mem = new List<ushort>(); foreach (var line in Properties.Resources.ExampleProgram.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries) .Select(l => l.Split(':')[1])) { foreach (var b in line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)) { mem.Add(ushort.Parse(b, NumberStyles.HexNumber)); } } var cpu = new Cpu(mem.ToArray()); Console.WriteLine(cpu.Status()); Console.WriteLine(); while (true) { cpu.Tick(); Console.WriteLine(cpu.Status()); Console.WriteLine(); Thread.Sleep(250); } }
public InternalValue(SaveLocation loc, Cpu cpu) { this.Buffer = null; this.Index = 0; this.SaveLoc = loc; this.Literal = 0; this.MyCpu = cpu; }
public InternalValue(ushort lit) { this.Buffer = null; this.Index = 0; this.SaveLoc = SaveLocation.Literal; this.Literal = lit; this.MyCpu = null; }
public InternalValue(ushort[] buffer, ushort index) { this.Buffer = buffer; this.Index = index; this.SaveLoc = SaveLocation.Memory; this.Literal = 0; this.MyCpu = null; }