public CPU() { mem = new MemoryBasic(); mem.Init(Config.MEM_SIZE); registerSet = new RegisterSet(); }
public void GetRegisterValMin500Test() { RegisterSet target = new RegisterSet(); for (int registerNr = 0; registerNr < RegisterSet.LastRegisterNr; registerNr++) { target.SetRegisterVal(registerNr, -500); int expected = -500; int actual = target.GetRegisterVal(registerNr); Assert.AreEqual(expected, actual); } }
public void GetRegisterValAccuTest() { RegisterSet target = new RegisterSet(); int[] testValues = { 0, -8500, 8500, 7000, 2, -66000, 65535, -65534, 900000 }; foreach (int expected in testValues) { target.Accu = expected; int actual = target.Accu; Assert.AreEqual(expected, actual); } }