Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public void POP_qqTest()
 {
     PrivateObject z = new PrivateObject(new Z80(new Memory48K()));
     Z80_Accessor target = new Z80_Accessor(z);
     target.SP = 0x1000;
     target.Memory[0x1000] = 0x55;
     target.Memory[0x1001] = 0x33;
     target.POP_qq(2);
     Assert.IsTrue(target.Get16BitRegisters(2) == 0x3355 && target.SP == 0x1002, "Error: POP qq");
 }