internal void DataOpHandleSetFlagsAWC_NonCMP(uint opcode, uint Rd, AWCResult awcResult) { if (Rd == GeneralPurposeRegisters.PCRegisterIndex) { CPSR.RestoreCPUMode(); } else { DataOpHandleSetFlagsAWC_CMP(opcode, Rd, awcResult); } }
internal InstructionFunc GenerateAWCDataOp(DataOpEvaluateOperand2Func EvaluateOperand2, DataOpAWCOperation AWCOp, DataOpSaveResultFunc SaveResult, DataOpHandleSetFlagsAWCFunc SetFlags) { return(delegate(uint opcode) { uint Rd = ((opcode & rd_mask) >> 12); uint Rn = ((opcode & rn_mask) >> 16); uint a = get_reg(Rn); bool shift_carry = false; uint b = EvaluateOperand2(opcode, ref shift_carry); AWCResult awcResult = AWCOp(a, b); SaveResult(Rd, awcResult.result); SetFlags(opcode, Rd, awcResult); return 1; }); }
internal void DataOpHandleSetFlagsAWC_CMP(uint opcode, uint Rd, AWCResult awcResult) { //The CPSR is set the same way for all AWC-based instructions (the only difference //is the input to AWC). CPSR.set_NZCV((awcResult.result & 0x80000000) != 0, awcResult.result == 0, awcResult.carry_out, awcResult.overflow); }
internal void DataOpHandleSetFlagsAWC_NOP(uint opcode, uint Rd, AWCResult awcResult) { }