public override void Execute(CPU cpu) { cpu.MoveStackPointer(1); int destinationPointer = (int)cpu.PopValue(); int currentPointer = cpu.InstructionPointer; DeltaInstructionPointer = destinationPointer - currentPointer; }
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); } } }