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

            /* NOP */
            if (i.RA() == i.RS() && i.RS() == 0 && i.UIMM() == 0)
                return new List<CStatement>();

            CStatement stat;

            if (i.RS() == 0)
                stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RA()), i.UIMM());
            else if (i.UIMM() == 0)
                stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RA()), RegName(i.RS()));
            else
            {
                CStatement or = new CStatement(CStatement.Kinds.Or, RegName(i.RS()), i.UIMM());
                or.OperandSizes = CStatement.Sizes.Long;

                stat = new CStatement(CStatement.Kinds.Assignment, RegName(i.RA()), or);
            }

            stat.OperandSizes = CStatement.Sizes.Long;

            List<CStatement> stats = new List<CStatement>();
            stats.Add(stat);
            return stats;
        }
예제 #2
0
        static List<CStatement> Cmpli_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);

            CStatement ass;
            if (i.UIMM() != 0)
            {
                CStatement stat = new CStatement(CStatement.Kinds.Subtraction, RegName(i.RA()), (ulong)i.UIMM());
                if (!i.CmpLong())
                    stat.OperandSizes = CStatement.Sizes.Int;
                ass = new CStatement(CStatement.Kinds.Assignment, "cr" + i.CRFD(), stat);
            }
            else
                ass = new CStatement(CStatement.Kinds.Assignment, "cr" + i.CRFD(), RegName(i.RA()));

            if (!i.CmpLong())
                ass.OperandSizes = CStatement.Sizes.Int;

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