internal static void WordAt(Cpu.Cpu cpu, int ofs, ushort expected) { ushort actual = (ushort)((cpu.PhysicalMemory[ofs + 1] << 8) | cpu.PhysicalMemory[ofs]); string message = "Assert.WordAt: M[" + ofs.ToString() + "] == " + actual.ToString() + " != " + expected.ToString(); Assert.AreEqual(actual, expected, message: message); }
internal static void Reg(Cpu.Cpu cpu, int rn, ushort expected) { ushort actual = cpu.Registers[rn]; string message = "Assert.Reg: r" + rn.ToString() + " == " + actual.ToString() + " != " + expected.ToString(); Assert.AreEqual(actual, expected, message: message); }
internal static void ByteAt(Cpu.Cpu cpu, int ofs, byte expected) { byte actual = cpu.PhysicalMemory[ofs]; string message = "Assert.ByteAt: M[" + ofs.ToString() + "] == " + actual.ToString() + " != " + expected.ToString(); Assert.AreEqual(actual, expected, message: message); }
internal static void WordAt(Cpu.Cpu cpu, string ofs, string octal) { Assert.WordAt(cpu, ofs.AsOctal(), octal.AsOctal()); }
internal static void Reg(Cpu.Cpu cpu, int rn, string octal) { Assert.Reg(cpu, rn, octal.AsOctal()); }
internal static void PC(Cpu.Cpu cpu, string value) { Assert.PC(cpu, value.AsOctal()); }
internal static void PC(Cpu.Cpu cpu, ushort value) { Assert.Reg(cpu, 7, value); }