本文整理汇总了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;
}