Example #1
0
 public void ADD_A_nTest()
 {
     PrivateObject param0 = new PrivateObject(new Z80(new Memory48K()));
     Z80_Accessor target = new Z80_Accessor(param0);
     target.A = 0x01;
     target.Memory[0] = 0x04;
     target.ADD_A_n();
     Assert.IsTrue(target.A == 0x05, "Error: ADD A, n");
 }
Example #2
0
 public void CarryTest()
 {
     PrivateObject param0 = new PrivateObject(new Z80(new Memory48K()));
     Z80_Accessor target = new Z80_Accessor(param0);
     target.A = 5;
     target.Memory[0] = 3;
     target.ADD_A_n();
     Assert.IsTrue((target.F & Flag.Carry) != Flag.Carry
             && (target.F & Flag.HalfCarry) != Flag.HalfCarry);
     target.Memory[1] = 255;
     target.ADD_A_n();
     Assert.IsTrue((target.F & Flag.Carry) == Flag.Carry
             && (target.F & Flag.HalfCarry) == Flag.HalfCarry);
     target.Memory[2] = 248;
     target.ADC_A_n();
     Assert.IsTrue(target.A == 0
         && (target.F & Flag.Zero) == Flag.Zero);
 }