示例#1
0
        public override void Execute(CPU cpu)
        {
            cpu.MoveStackPointer(1);
            int destinationPointer = (int)cpu.PopValue();
            int currentPointer     = cpu.InstructionPointer;

            DeltaInstructionPointer = destinationPointer - currentPointer;
        }
示例#2
0
        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);
                }
            }
        }