Exemplo n.º 1
0
 public void Ife_RegisterOperandsAreNotEqual_PCSkipsNextInstructionAndOperands()
 {
     var prev = new MutableState()
         .Set(Register.A, 1).Set(Register.B, 2)
         .Set((ushort)0, 0x7C02)
         .Set((ushort)1, 0x002A);
     var state = new Ife(new Reg(Register.A), new Reg(Register.B)).Apply(prev);
     Assert.AreEqual(2, state.Get(Register.PC));
 }
Exemplo n.º 2
0
 public void Ife_RegisterOperandsAreEqual_PCIsNotUpdated()
 {
     var prev = new MutableState().Set(Register.A, 1).Set(Register.B, 1);
     var state = new Ife(new Reg(Register.A), new Reg(Register.B)).Apply(prev);
     Assert.AreEqual(0, state.Get(Register.PC));
 }