Пример #1
0
 public static Instruction Create(uint regdst, ValBase value)
 {
     if (value is ValReg)
     {
         var ins = new T();
         ins.RegDst = regdst;
         ins.RegSrc = (value as ValReg).Index;
         return(ins);
     }
     else if (value is ValInstant)
     {
         var val = (value as ValInstant).Val;
         if (val < -(1 << 15) || val >= 1 << 15)
         {
             return(Failed.OutOfRange);
         }
         var ins = new AsmBinaryOpInstant <T>();
         ins.RegDst = regdst;
         ins.Value  = (value as ValInstant).Val;
         return(ins);
     }
     else
     {
         return(Failed.NotImplemented);
     }
 }
Пример #2
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));
        }
Пример #3
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);
        }
Пример #4
0
 public Mov(ValRegEx regdst, ValBase value)
 {
     RegDst = regdst;
     Value  = value;
 }
Пример #5
0
 public For(ValBase count)
 {
     Count = count;
 }
Пример #6
0
 public For_Static(ValBase count)
     : base(count)
 {
 }
Пример #7
0
 public For_Full(ValRegEx regiter, ValBase initval, ValBase count)
     : base(count)
 {
     RegIter = regiter;
     InitVal = initval;
 }
Пример #8
0
 public Wait(ValBase duration, bool omitted)
 {
     Duration = duration;
     _omitted = omitted;
 }
Пример #9
0
 public StickPress(NintendoSwitch.Key key, string keyname, string direction, ValBase duration)
     : base(key, keyname, direction)
 {
     Duration = duration;
 }
Пример #10
0
 public ElseIf(CompareOperator op, ValVar left, ValBase right)
 {
     Operater = op;
     Left     = left;
     Right    = right;
 }
Пример #11
0
 public BinaryOp(ValRegEx regdst, ValBase value)
 {
     RegDst = regdst;
     Value  = value;
 }
Пример #12
0
 public If(CompareOperator op, ValRegEx left, ValBase right)
 {
     Operater = op;
     Left     = left;
     Right    = right;
 }
Пример #13
0
 public KeyPress(NintendoSwitch.ECKey key, ValBase duration)
     : base(key)
 {
     Duration = duration;
 }
Пример #14
0
 public KeyPress(NintendoSwitch.ECKey key)
     : base(key)
 {
     Duration = DefaultDuration;
     _omitted = true;
 }
Пример #15
0
 public Sub(ValRegEx regdst, ValBase value)
     : base(regdst, value)
 {
 }
Пример #16
0
 public ShiftRight(ValRegEx regdst, ValBase value)
     : base(regdst, value)
 {
 }