Beispiel #1
0
 public void Div_DivisorIsZero_ResultAndOverflowAreZero()
 {
     var prev = new MutableState().Set(Register.A, 1);
     var state = new Div(new Reg(Register.A), new Literal(0)).Apply(prev);
     Assert.AreEqual(0x0, state.Get(Register.A));
     Assert.AreEqual(0x0, state.Get(Register.O));
 }
Beispiel #2
0
 public void Div_DivideRegisters_ResultAndOverflowAreCorrect()
 {
     var prev = new MutableState().Set(Register.A, 3).Set(Register.B, 2);
     var state = new Div(new Reg(Register.A), new Reg(Register.B)).Apply(prev);
     Assert.AreEqual(0x1, state.Get(Register.A));
     Assert.AreEqual(0x8000, state.Get(Register.O));
 }