Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
        }