def execute_cmn(s, inst): if condition_passed(s, inst.cond()): a, (b, _) = s.rf[inst.rn()], shifter_operand(s, inst) result = a + b s.N = (result >> 31) & 1 s.Z = trim_32(result) == 0 s.C = carry_from(result) s.V = overflow_from_add(a, b, result) if inst.rd() == 15: return s.rf[PC] = s.fetch_pc() + 4
def execute_cmn( s, inst ): if condition_passed( s, inst.cond ): a, (b, _) = s.rf[ inst.rn ], shifter_operand( s, inst ) result = a + b s.N = (result >> 31)&1 s.Z = trim_32( result ) == 0 s.C = carry_from( result ) s.V = overflow_from_add( a, b, result ) if inst.rd == 15: return s.rf[PC] = s.fetch_pc() + 4
def execute_add(s, inst): if condition_passed(s, inst.cond): a, (b, _) = s.rf[inst.rn], shifter_operand(s, inst) result = a + b s.rf[inst.rd] = trim_32(result) if inst.S: if inst.rd == 15: raise FatalError('Writing SPSR not implemented!') s.N = (result >> 31) & 1 s.Z = trim_32(result) == 0 s.C = carry_from(result) s.V = overflow_from_add(a, b, result) if inst.rd == 15: return s.rf[PC] = s.fetch_pc() + 4
def execute_add( s, inst ): if condition_passed( s, inst.cond ): a, (b, _) = s.rf[ inst.rn ], shifter_operand( s, inst ) result = a + b s.rf[ inst.rd ] = trim_32( result ) if inst.S: if inst.rd == 15: raise FatalError('Writing SPSR not implemented!') s.N = (result >> 31)&1 s.Z = trim_32( result ) == 0 s.C = carry_from( result ) s.V = overflow_from_add( a, b, result ) if inst.rd == 15: return s.rf[PC] = s.fetch_pc() + 4