Пример #1
0
        public void VerifyValuesOfZeroFlag(int initialValue, bool expectedResult)
        {
            var model = new ProgrammingModel();
              model.GetRegister(RegisterName.X).SetValue(initialValue);
              model.ZeroFlag = !expectedResult;

              var instruction = new Inx();
              instruction.Execute(model, null, 0);

              Assert.That(model.ZeroFlag, Is.EqualTo(expectedResult));
        }
Пример #2
0
        public void IncrementsTheValueInRegisterX()
        {
            const int initialValue = 42;

              var model = new ProgrammingModel();
              model.GetRegister(RegisterName.X).SetValue(initialValue);
              var instruction = new Inx();
              instruction.Execute(model, null, 0);
              Assert.That(model.GetRegister(RegisterName.X).GetValue(),
                  Is.EqualTo(initialValue + 1));
        }
Пример #3
0
 public void ReturnsTwoCycles()
 {
     var instruction = new Inx();
       Assert.That(instruction.CyclesFor(AddressingMode.Implied), Is.EqualTo(2));
 }