public virtual VMPrimitiveExitCode Execute(VMStackFrame frame, out VMInstruction instruction) { instruction = frame.GetCurrentInstruction(); var opcode = instruction.Opcode; if (opcode >= 256) { frame.Thread.ExecuteSubRoutine(frame, opcode, (VMSubRoutineOperand)instruction.Operand); return(VMPrimitiveExitCode.CONTINUE); } var primitive = VMContext.Primitives[opcode]; if (primitive == null) { return(VMPrimitiveExitCode.GOTO_TRUE); } VMPrimitiveHandler handler = primitive.GetHandler(); return(handler.Execute(frame, instruction.Operand)); }
public VMInstructionDisplay(VMInstruction inst) { this.Primitive = inst.Function.VM.Context.Primitives[inst.Opcode]; //vm.Context.GetPrimitive(inst.Opcode) this.Instruction = inst; }