Пример #1
0
 private void Predicate(ArmCodeCondition cond, RtlInstruction instr)
 {
     if (cond == ArmCodeCondition.AL)
     {
         emitter.Emit(instr);
     }
     else
     {
         emitter.If(TestCond(cond), instr);
     }
 }
Пример #2
0
        private void RewriteB(bool link)
        {
            Address addr = Address.Ptr32((uint)Dst.ImmediateValue.Value);

            if (link)
            {
                ric.Class = RtlClass.Transfer;
                if (instr.ArchitectureDetail.CodeCondition == ArmCodeCondition.AL)
                {
                    emitter.Call(addr, 0);
                }
                else
                {
                    emitter.If(TestCond(instr.ArchitectureDetail.CodeCondition), new RtlCall(addr, 0, RtlClass.Transfer));
                }
            }
            else
            {
                if (instr.ArchitectureDetail.CodeCondition == ArmCodeCondition.AL)
                {
                    ric.Class = RtlClass.Transfer;
                    emitter.Goto(addr);
                }
                else
                {
                    ric.Class = RtlClass.ConditionalTransfer;
                    emitter.Branch(TestCond(instr.ArchitectureDetail.CodeCondition), addr, RtlClass.ConditionalTransfer);
                }
            }
        }
Пример #3
0
        private void RewriteB(bool link)
        {
            Address addr = ((AddressOperand)instr.Dst).Address;

            if (link)
            {
                if (instr.Cond == Condition.al)
                {
                    emitter.Call(addr, 0);
                }
                else
                {
                    emitter.If(TestCond(instr.Cond), new RtlCall(addr, 0, RtlClass.Transfer));
                }
            }
            else
            {
                if (instr.Cond == Condition.al)
                {
                    emitter.Goto(addr);
                }
                else
                {
                    emitter.Branch(TestCond(instr.Cond), addr, RtlClass.ConditionalTransfer);
                }
            }
        }
Пример #4
0
        private void RewriteB(bool link)
        {
            Expression dst;

            if (Dst.Type == ArmInstructionOperandType.Immediate)
            {
                dst = Address.Ptr32((uint)Dst.ImmediateValue.Value);
            }
            else
            {
                dst = Operand(Dst);
            }
            if (link)
            {
                ric.Class = RtlClass.Transfer;
                if (instr.ArchitectureDetail.CodeCondition == ArmCodeCondition.AL)
                {
                    m.Call(dst, 0);
                }
                else
                {
                    m.If(TestCond(instr.ArchitectureDetail.CodeCondition), new RtlCall(dst, 0, RtlClass.Transfer));
                }
            }
            else
            {
                if (instr.ArchitectureDetail.CodeCondition == ArmCodeCondition.AL)
                {
                    ric.Class = RtlClass.Transfer;
                    m.Goto(dst);
                }
                else
                {
                    ric.Class = RtlClass.ConditionalTransfer;
                    var addr = dst as Address;
                    if (addr != null)
                    {
                        m.Branch(TestCond(instr.ArchitectureDetail.CodeCondition), addr, RtlClass.ConditionalTransfer);
                    }
                    else
                    {
                        m.If(TestCond(instr.ArchitectureDetail.CodeCondition), new RtlGoto(dst, RtlClass.ConditionalTransfer));
                    }
                }
            }
        }