Esempio n. 1
0
        public static Instruction Create(uint regdst, ValBase value)
        {
            var ins = AsmMovCompressed.Create(regdst, value);

            if (ins.Success)
            {
                return(ins);
            }
            return(AsmBinaryOp <AsmMov> .Create(regdst, value));
        }
Esempio n. 2
0
        public static Instruction Create(uint regdst, ValBase value)
        {
            if (!(value is ValInstant))
            {
                return(Failed.InvalidArgument);
            }
            var val = (value as ValInstant).Val;

            if (val < -(1 << 6) || val >= 1 << 6)
            {
                return(Failed.OutOfRange);
            }
            var ins = new AsmMovCompressed();

            ins.RegDst = regdst;
            ins.Value  = val;
            return(ins);
        }