当前位置: 首页>>代码示例>>C#>>正文


C# Instruction.BI方法代码示例

本文整理汇总了C#中Instruction.BI方法的典型用法代码示例。如果您正苦于以下问题:C# Instruction.BI方法的具体用法?C# Instruction.BI怎么用?C# Instruction.BI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Instruction的用法示例。


在下文中一共展示了Instruction.BI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConditionCheck

        private static CStatement ConditionCheck(Instruction i)
        {
            CStatement CtrCondition = null;
            CStatement CrCondition = null;

            if ((i.BO() & 4) == 0)
            {
                CtrCondition = new CStatement();
            }

            if ((i.BO() & 0x10) == 0)
            {
                CrCondition = new CStatement();
                CrCondition.Kind = CStatement.Kinds.Comparison;

                uint cr = i.BI() / 4;
                uint fld = i.BI() % 4;

                CrCondition.Op1 = new CStatement.COperand("cr" + cr);
                CrCondition.Op2 = new CStatement.COperand(0);

                bool bo = ((i.BO() >> 3) & 1) == 1;
                switch (fld)
                {
                    case 0:
                        if (bo)
                            CrCondition.ConditionSign = CStatement.Conditions.LessThan;
                        else
                            CrCondition.ConditionSign = CStatement.Conditions.GreaterEqualThan;
                        break;
                    case 1:
                        if (bo)
                            CrCondition.ConditionSign = CStatement.Conditions.GreaterThan;
                        else
                            CrCondition.ConditionSign = CStatement.Conditions.LessEqualThan;
                        break;
                    case 2:
                        if (bo)
                            CrCondition.ConditionSign = CStatement.Conditions.Equal;
                        else
                            CrCondition.ConditionSign = CStatement.Conditions.NotEqual;
                        break;
                    case 3:
                        if (bo)
                            CrCondition.ConditionSign = CStatement.Conditions.Overflow;
                        else
                            CrCondition.ConditionSign = CStatement.Conditions.NotOverflow;
                        break;
                }
            }

            CStatement final = null;

            if (CrCondition != null)
            {
                if (CtrCondition != null)
                {
                    CStatement composite = new CStatement(CStatement.Kinds.CompositeCondition, CrCondition, CtrCondition);
                    composite.ConditionSign = CStatement.Conditions.And;

                    final = new CStatement();
                    final.Kind = CStatement.Kinds.Conditional;
                    final.Condition = composite;
                }
                else
                {
                    final = new CStatement();
                    final.Kind = CStatement.Kinds.Conditional;
                    final.Condition = CrCondition;
                }
            }
            else if (CtrCondition != null)
            {
                final = new CStatement();
                final.Kind = CStatement.Kinds.Conditional;
                final.Condition = CtrCondition;
            }

            return final;
        }
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:80,代码来源:XenonInstructions.cs


注:本文中的Instruction.BI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。