예제 #1
0
        // UpValue[A][RK(B)] := RK(C)
        internal static void setTabUp(Instruction i, ref LuaVM vm)
        {
            var(a, b, c) = i.ABC();
            a           += 1;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.SetTable(LuaVM.LuaUpvalueIndex(a));
        }
예제 #2
0
        internal static void SetTable(Instruction i, ref LuaVM vm)
        {
            var(a, b, c) = i.ABC();
            a           += 1;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.SetTable(a);
        }
예제 #3
0
        private static void _binaryArith(Instruction i, LuaVM vm, ArithOp op)
        {
            var(a, b, c) = i.ABC();
            a           += 1;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.Arith(op);
            vm.Replace(a);
        }
예제 #4
0
        private static void _binaryArith(Instruction i, LuaVM vm, ArithOp op)
        {
            var abc = i.ABC();
            var a   = abc.Item1 + 1;
            var b   = abc.Item2;
            var c   = abc.Item3;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.Arith(op);
            vm.Replace(a);
        }
예제 #5
0
        internal static void setTable(Instruction i, ref LuaVM vm)
        {
            var abc = i.ABC();
            var a   = abc.Item1;
            var b   = abc.Item2;
            var c   = abc.Item3;

            a += 1;

            vm.GetRK(b);
            vm.GetRK(c);
            vm.SetTable(a);
        }
예제 #6
0
        private static void Compare(Instruction i, ref LuaVM vm, CompareOp op)
        {
            var(a, b, c) = i.ABC();

            vm.GetRK(b);
            vm.GetRK(c);
            var br = vm.Compare(-2, -1, op) != (a != 0);

            if (br)
            {
                vm.AddPC(1);
            }

            vm.Pop(2);
        }
예제 #7
0
        internal static void _compare(Instruction i, ref LuaVM vm, CompareOp op)
        {
            var abc = i.ABC();
            var a   = abc.Item1;
            var b   = abc.Item2;
            var c   = abc.Item3;

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

            vm.Pop(2);
        }
예제 #8
0
        // R(A) := UpValue[B][RK(C)]
        internal static void getTabUp(Instruction i, ref LuaVM vm)
        {
            var(a, b, c) = i.ABC();
            a           += 1;
            b           += 1;

            vm.GetRK(c);
            vm.GetTable(LuaVM.LuaUpvalueIndex(b));
            vm.Replace(a);
        }
예제 #9
0
        // R(A+1) := R(B); R(A) := R(B)[RK(C)]
        internal static void Self(Instruction i, ref LuaVM 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);
        }
예제 #10
0
        // R(A+1) := R(B); R(A) := R(B)[RK(C)]
        internal static void self(Instruction i, ref LuaVM vm)
        {
            var abc = i.ABC();
            var a   = abc.Item1 + 1;
            var b   = abc.Item2 + 1;
            var c   = abc.Item3;

            vm.Copy(b, a + 1);
            vm.GetRK(c);
            vm.GetTable(b);
            vm.Replace(a);
        }
예제 #11
0
        internal static void getTabUp(Instruction i, ref LuaVM vm)
        {
            var a_c = i.ABC();
            var a   = a_c.Item1 + 1;
            var c   = a_c.Item3;

            vm.PushGlobalTable();
            vm.GetRK(c);
            vm.GetTable(-2);
            vm.Replace(a);
            vm.Pop(1);
        }