private static void JumpOnPlusAction( CpuRegister r, Word operand, CpuRegisterSet registerSet, Memory memory) { FlagRegister fr = registerSet.FR; Boolean condition = (!fr.SF && !fr.ZF); DoJump(condition, operand, registerSet.PR); }
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); }
/// <summary> /// <see cref="CpuRegisterSet"/> のインスタンスを初期化します。 /// </summary> internal CpuRegisterSet() { m_generalRegisters = new GeneralRegisters(); m_stackPointer = new CpuRegister(RegisterDef.SP); m_programRegister = new CpuRegister(RegisterDef.PR); m_flagRegister = new FlagRegister(); Reset(); }
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 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); }
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); }