예제 #1
0
        static List<CStatement> Mtspr_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

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

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

            List<CStatement> stats = new List<CStatement>();
            stats.Add(stat);
            return stats;
        }