Exemple #1
0
 /// <summary>
 /// UpValue[A][RK(B)] = RK(C)
 /// </summary>
 public static void SetTabUp(Instruction ins, ILuaVM vm)
 {
     ins.ABC(out var a, out var b, out var c);
     a += 1;
     vm.GetRK(b);
     vm.GetRK(c);
     vm.SetTable(vm.LuaUpvalueIndex(a));
 }
Exemple #2
0
        /// <summary>
        /// R(A)[RK(B)] = RK(C)
        /// </summary>
        public static void SetTable(Instruction ins, ILuaVM vm)
        {
            ins.ABC(out var a, out var b, out var c);
            a += 1;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.SetTable(a);
        }
Exemple #3
0
    public static void SetTable(Instruction i, ILuaVM vm)
    {
        var(a, b, c) = i.ABC();
        a           += 1;

        vm.GetRK(b);
        vm.GetRK(c);
        vm.SetTable(a);
    }
Exemple #4
0
    internal static void SetTabUp(Instruction i, ILuaVM vm)
    {
        var(a, b, c) = i.ABC();
        a           += 1;

        vm.GetRK(b);
        vm.GetRK(c);
        vm.SetTable(LuaState.LuaUpvalueIndex(a));
    }
Exemple #5
0
    private static void BinaryArith(Instruction i, ILuaVM vm, ArithOp op)
    {
        var(a, b, c) = i.ABC();
        a           += 1;

        vm.GetRK(b);
        vm.GetRK(c);
        vm.Arith(op);
        vm.Replace(a);
    }
Exemple #6
0
        //R(A)[RK(B)] := RK(C)
        public static void SetTable(int i, ILuaVM vm)
        {
            int a = Instruction.GetA(i) + 1;
            int b = Instruction.GetB(i) + 1;
            int c = Instruction.GetC(i);

            vm.GetRK(b);
            vm.GetRK(c);
            vm.SetTable(a);
        }
Exemple #7
0
        /// <summary>
        /// R(A) = RK(B) op RK(C)
        /// </summary>
        private static void BinaryArith(Instruction ins, ILuaVM vm, EArithOp op)
        {
            ins.ABC(out var a, out var b, out var c);
            a += 1;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.Arith(op);
            vm.Replace(a);
        }
Exemple #8
0
        private static void binaryArith(int i, ILuaVM vm, ArithOpEnum op)
        {
            int a = Instruction.GetA(i) + 1;
            int b = Instruction.GetB(i);
            int c = Instruction.GetC(i);

            vm.GetRK(b);
            vm.GetRK(c);
            vm.Arith(op);
            vm.Replace(a);
        }
Exemple #9
0
    private static void Compare(Instruction i, ILuaVM vm, CompareOp op)
    {
        var(a, b, c) = i.ABC();

        vm.GetRK(b);
        vm.GetRK(c);
        if (vm.Compare(-2, -1, op) != (a != 0))
        {
            vm.AddPC(1);
        }
        vm.Pop(2);
    }
Exemple #10
0
        /// <summary>
        /// if ((RK(B) op RK(C)) != A)
        ///     pc++
        /// </summary>
        private static void Compare(Instruction ins, ILuaVM vm, ECompOp op)
        {
            ins.ABC(out var a, out var b, out var c);

            vm.GetRK(b);
            vm.GetRK(c);

            if (vm.Compare(-2, -1, op) != (a != 0))
            {
                vm.AddPC(1);
            }

            vm.Pop(2);
        }
Exemple #11
0
        /// <summary>
        /// R(A + 1) = R(B)
        /// R(A) = R(B)[RK(C)]
        /// </summary>
        public static void Self(Instruction ins, ILuaVM vm)
        {
            ins.ABC(out var a, out var b, out var c);
            a += 1;
            b += 1;

            vm.Copy(b, a + 1);
            vm.GetRK(c);
            vm.GetTable(b);
            vm.Replace(a);
        }
Exemple #12
0
    internal static void Self(Instruction i, ILuaVM vm)
    {
        var(a, b, c) = i.ABC();
        a           += 1;
        b           += 1;

        vm.Copy(b, a + 1);
        vm.GetRK(c);
        vm.GetTable(b);
        vm.Replace(a);
    }
Exemple #13
0
        //R(A + 1) := R(B); R(A) := R(B)[RK(C)]
        public static void Self(int i, ILuaVM vm)
        {
            int a = Instruction.GetA(i) + 1;
            int b = Instruction.GetB(i) + 1;
            int c = Instruction.GetC(i);

            vm.Copy(b, a + 1);
            vm.GetRK(c);
            vm.GetTable(b);
            vm.Replace(a);
        }