Exemple #1
0
 private void runLuaClosure()
 {
     for (; ;)
     {
         int    i      = Fetch();
         OpCode opCode = Instruction.GetOpCode(i);
         opCode.Action(i, this);
         if (opCode.Equals(OpCodeEnum.OP_RETURN))
         {
             break;
         }
     }
 }
Exemple #2
0
        private static void luaMain(Prototype proto)
        {
            ILuaVM vm = new LuaStateImplement();

            vm.SetTop(proto.MaxStackSize);
            for (; ;)
            {
                int    pc     = vm.GetPC();
                int    i      = vm.Fetch();
                OpCode opCode = Instruction.GetOpCode(i);
                if (opCode.NotEqual(OpCodeEnum.OP_RETURN))
                {
                    opCode.Action(i, vm);
                    System.Console.WriteLine($"Pc {pc + 1} ,OpcodeName {opCode.Name}");
                    printStack(vm);
                }
                else
                {
                }
            }
        }
Exemple #3
0
        public static void luaMain(Prototype proto)
        {
            ILuaVM vm = new LuaStateImplement(proto);

            vm.SetTop(proto.MaxStackSize);
            for (; ;)
            {
                int    pc     = vm.GetPC();
                int    i      = vm.Fetch();
                OpCode opCode = Instruction.GetOpCode(i);
                if (opCode.NotEqual(OpCodeEnum.OP_RETURN))
                {
                    opCode.Action(i, vm);
                    Console.WriteLine(string.Format("[{0}] {1}", pc + 1, opCode.ToString()));
                    printStack(vm);
                }
                else
                {
                    break;
                }
            }
        }