示例#1
0
        public void VerifyValuesOfZeroFlag(int initialValue, bool expectedResult)
        {
            var model = new ProgrammingModel();
              model.GetRegister(RegisterName.Y).SetValue(initialValue);
              model.ZeroFlag = !expectedResult;

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

              Assert.That(model.ZeroFlag, Is.EqualTo(expectedResult));
        }
示例#2
0
        public void IncrementsTheValueInRegisterY()
        {
            const int initialValue = 42;

              var model = new ProgrammingModel();
              model.GetRegister(RegisterName.Y).SetValue(initialValue);
              var instruction = new Iny();
              instruction.Execute(model, null, 0);
              Assert.That(model.GetRegister(RegisterName.Y).GetValue(),
                  Is.EqualTo(initialValue + 1));
        }
示例#3
0
 public void ReturnsTwoCycles()
 {
     var instruction = new Iny();
       Assert.That(instruction.CyclesFor(AddressingMode.Implied), Is.EqualTo(2));
 }