private void runLuaClosure() { for (; ;) { int i = Fetch(); OpCode opCode = Instruction.GetOpCode(i); opCode.Action(i, this); if (opCode.Equals(OpCodeEnum.OP_RETURN)) { break; } } }
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 { } } }
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; } } }