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


C# Instruction.RD方法代码示例

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


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

示例1: Add_C

        static List<CStatement> Add_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

            /* op1 + op2 */
            CStatement stat = new CStatement(CStatement.Kinds.Addition, RegName(i.RA()), RegName(i.RB()));

            /* dest = expr */
            CStatement ass = new CStatement(CStatement.Kinds.Assignment, RegName(i.RD()), stat);

            List<CStatement> stats = new List<CStatement>();
            stats.Add(ass);

            if (i.OE())
                MessageBox.Show("This instruction sets the O bit. I don't know how to translate it! Ignoring.");

            if (i.RC())
                stats.Add(new CStatement(CStatement.Kinds.Assignment, "cr0", RegName(i.RD())));

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

示例2: Addi_C

        static List<CStatement> Addi_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

            CStatement stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RD()));

            if (i.RA() == 0)
                stat.Op2 = new CStatement.COperand((ulong)(long)i.SIMM());
            else if (i.SIMM() == 0)
                stat.Op2 = new CStatement.COperand(RegName(i.RA()));
            else
            {
                CStatement add = new CStatement(CStatement.Kinds.Addition, RegName(i.RA()), (ulong)(long)i.SIMM());

                long val = (long)add.Op2.Value;
                if (val < 0)
                {
                    add.Kind = CStatement.Kinds.Subtraction;
                    add.Op2.Value = (ulong)-val;
                }

                stat.Op2 = new CStatement.COperand(add);
            }

            List<CStatement> stats = new List<CStatement>();
            stats.Add(stat);
            return stats;
        }
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:28,代码来源:XenonInstructions.cs

示例3: Lwz_C

        static List<CStatement> Lwz_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

            CStatement stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RD()));
            stat.OperandSizes = CStatement.Sizes.Int;

            int ds = (int)i.SIMM();
            if (i.RA() != 0)
                stat.Op2 = new CStatement.COperand(RegName(i.RA()), ds);
            else
            {
                stat.Op2 = new CStatement.COperand();
                stat.Op2.Kind = CStatement.OperandKinds.AddressPointer;
                stat.Op2.Offset = ds;
            }

            List<CStatement> stats = new List<CStatement>();
            stats.Add(stat);
            return stats;
        }
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:21,代码来源:XenonInstructions.cs

示例4: Mfspr_C

        static List<CStatement> Mfspr_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

            CStatement stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RD()));
            stat.OperandSizes = CStatement.Sizes.Long;

            stat.Op2 = new CStatement.COperand();
            stat.Op2.Kind = CStatement.OperandKinds.Variable;
            switch (i.SPR())
            {
                case 32:
                    stat.Op2.Name = "xer";
                    break;
                case 256:
                    stat.Op2.Name = "lr";
                    break;
                case 288:
                    stat.Op2.Name = "ctr";
                    break;
                default:
                    stat.Op2.Name = "spr" + i.SPR();
                    break;
            }

            List<CStatement> stats = new List<CStatement>();
            stats.Add(stat);
            return stats;
        }
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:29,代码来源:XenonInstructions.cs

示例5: Lbzx_C

        static List<CStatement> Lbzx_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

            CStatement stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RD()));
            stat.OperandSizes = CStatement.Sizes.Byte;

            if (i.RA() != 0)
            {
                if (i.RB() != 0)
                    stat.Op2 = new CStatement.COperand(RegName(i.RA()), RegName(i.RB()));
                else
                    stat.Op2 = new CStatement.COperand(RegName(i.RA()), 0);
            }
            else
                stat.Op2 = new CStatement.COperand(RegName(i.RB()), 0);

            List<CStatement> stats = new List<CStatement>();
            stats.Add(stat);
            return stats;
        }
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:21,代码来源:XenonInstructions.cs


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