Exemplo n.º 1
0
        private static void DoOperation(
            Alu.OperationMethod operationMethod, CpuRegister r, Word operand, FlagRegister fr, Memory memory)
        {
            Boolean overflowFlag;

            r.Value = operationMethod(r.Value, operand, out overflowFlag);
            fr.SetFlags(r, overflowFlag);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        private static void DoCompare(
            Alu.CompareMethod compareMethod, CpuRegister r, Word operand, FlagRegister fr)
        {
            Boolean signFlag;
            Boolean zeroFlag;

            compareMethod(r.Value, operand, out signFlag, out zeroFlag);
            const Boolean OverflowFlag = false;

            fr.SetFlags(OverflowFlag, signFlag, zeroFlag);
        }
Exemplo n.º 4
0
        private static void DoLogic(
            Alu.OperationMethod operationMethod, CpuRegister r, Word operand, FlagRegister fr, Memory memory)
        {
            Boolean notUsed;

            r.Value = operationMethod(r.Value, operand, out notUsed);

            const Boolean OverflowFlag = false;

            fr.SetFlags(r, OverflowFlag);
        }