private void CheckShift_LastShiftedOutBit( Alu.ShiftMethod shiftMethod, UInt16 ui16Val, UInt16 count, UInt16 expected, String message) { Word word1 = new Word(ui16Val); Word word2 = new Word(count); UInt16 actual; Word notUsed = shiftMethod(word1, word2, out actual); Assert.AreEqual(expected, actual, message); }
private static void DoShift( Alu.ShiftMethod shiftMethod, CpuRegister r, Word operand, FlagRegister fr) { UInt16 lastShiftedOutBit; r.Value = shiftMethod(r.Value, operand, out lastShiftedOutBit); Boolean overflowFlag = (lastShiftedOutBit != 0); fr.SetFlags(r, overflowFlag); }
private void CheckShiftResult( Alu.ShiftMethod shiftMethod, UInt16 ui16Val, UInt16 count, UInt16 expected, String message) { Word word1 = new Word(ui16Val); Word word2 = new Word(count); UInt16 notUsed; Word resultWord = shiftMethod(word1, word2, out notUsed); WordTest.Check(resultWord, expected, message); }