Exemple #1
0
        /// <summary>
        /// 使用iabx模式指令,Ax操作数使用26位bit编码,最大可以表示67108864索引号
        /// </summary>
        /// <param name="i"></param>
        public void LoadKX(Instruction i)
        {
            int a = 0, bx = 0;

            i.ABX(ref a, ref bx);
            a += 1;
            int ax = new Instruction(luaState.Fetch()).AX();

            luaState.GetConstVar(ax);
            luaState.Replace(a);
        }
Exemple #2
0
        public void LuaMain(Prototype prototype)
        {
            int regsQuantity = prototype.MaxStackSize;

            luaState = new LuaAPI.LuaState(prototype);
            luaState.InitGlobal(prototype);
            luaState.RunLuaClosureAction = RunLuaClosure;
            //OpCode returnOp = Instruction.OpCodeTable[38];
            Console.WriteLine();
            while (true)
            {
                Instruction pc = new Instruction(luaState.Fetch());
                Console.WriteLine(pc.InstructionName);
                if (pc.OpCode != 38)
                {
                    pc.Execute(this);
                }
                else
                {
                    return;
                }
            }
        }