public void CPITest() { PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.Set16BitRegisters(2, 0x1111); target.Memory[0x1111] = 0x3b; target.A = 0x3b; target.Set16BitRegisters(0, 0x0001); target.CPI(); Assert.IsTrue(target.Get16BitRegisters(0) == 0 && target.Get16BitRegisters(2) == 0x1112 && (target.F & Flag.Zero) == Flag.Zero && (target.F & Flag.ParityOverflow) != Flag.ParityOverflow && target.A == 0x3b && target.Memory[0x1111] == 0x3b, "Error: CPI"); }
public void ZeroTest() { // 8-bit Load group PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.I = 3; target.LD_A_I(); Assert.IsTrue((target.F & Flag.Zero) != Flag.Zero); target.I = 0; target.LD_A_I(); Assert.IsTrue((target.F & Flag.Zero) == Flag.Zero); target.R = 3; target.LD_A_R(); Assert.IsTrue((target.F & Flag.Zero) != Flag.Zero); target.R = 0; target.LD_A_R(); Assert.IsTrue((target.F & Flag.Zero) == Flag.Zero); // Search Group target.A = 3; target.Set16BitRegisters(2, 0x1000); target.Memory[0x1000] = 3; target.CPI(); Assert.IsTrue((target.F & Flag.Zero) == Flag.Zero); target.A = 4; target.CPI(); Assert.IsTrue((target.F & Flag.Zero) != Flag.Zero); }