示例#1
0
文件: Opcode.cs 项目: WazWaz/KOS
 public override void Execute(CPU cpu)
 {
     object functionPointer = cpu.GetValue(destination);
     if (functionPointer is int)
     {
         int currentPointer = cpu.InstructionPointer;
         DeltaInstructionPointer = (int)functionPointer - currentPointer;
         cpu.PushStack(currentPointer + 1);
         cpu.MoveStackPointer(-1);
     }
     else
     {
         if (functionPointer is string)
         {
             string functionName = (string)functionPointer;
             functionName = functionName.Substring(0, functionName.Length - 2);
             cpu.CallBuiltinFunction(functionName);
         }
     }
 }