public void StackTest() { PrivateObject param0 = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(param0); target.Set16BitRegisters(0, 0x1234); Assert.IsTrue(target.B == 0x12 && target.C == 0x34); target.SP = 0x504; target.PUSH_qq(0); Assert.IsTrue(target.Memory[0x503] == 0x12 && target.Memory[0x502] == 0x34 && target.SP == 0x502); target.LD_dd_nn(0); target.POP_qq(0); Assert.IsTrue(target.B == 0x12 && target.C == 0x34 && target.SP == 0x504); }
public void PUSH_qqTest() { PrivateObject z = new PrivateObject(new Z80(new Memory48K())); Z80_Accessor target = new Z80_Accessor(z); target.A = 0x22; target.SetFlags(0x33); target.SP = 0x1007; target.PUSH_qq(3); Assert.IsTrue(target.Memory[0x1006] == 0x22 && target.Memory[0x1005] == 0x33 && target.SP == 0x1005, "Error: PUSH qq"); }