Beispiel #1
0
        public static void Execute()
        {
            int programLength = Program.Length;

            while (InstructionPointer >= 0 &&
                   InstructionPointer < programLength)
            {
                RegRead?.Invoke(null, EventArgs.Empty);

                Register[InstructionRegister] = InstructionPointer;
                Instruction current = Program[InstructionPointer];
                Register[current.Output] = current.Execute();
                InstructionPointer       = Register[InstructionRegister];
                InstructionPointer++;
            }
        }