/// <summary>
        /// Initializes a new instance of the <see cref="Form1" /> class.
        /// </summary>
        /// <param name="args">The args.</param>
        public Form1(string[] args)
        {
            InitializeComponent();

            cpu = new Cpu();
            cpu.CommandCounter = Cpu.FromShort(100);
            cpu.StepCounter    = 0;

            activeMode = fastToolStripMenuItem;
            StepMode   = (StepModeEnum)Enum.Parse(typeof(StepModeEnum), activeMode.Text);

#if DEBUG
            args    = new string[1];
            args[0] = @"C:\Dev\ASP.Net\Mini-Power-PC\Examples\Multiplikation.lvhe";
#endif

            // Falls ein File als Parameter mit angegeben wurde, den Emulator damit starten
            if (args.Length > 0)
            {
                FileTracker.ActiveFile = new FileInfo(args[0]);
                initGui();
            }
            toolStripStatusLabel2.Text = string.Empty;

            updateGui();
        }
        /// <summary>
        /// Handles the Click event of the resetToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void resetToolStripMenuItem_Click(object sender, EventArgs e)
        {
            cpu.CommandCounter = Cpu.FromShort(100);
            cpu.StepCounter    = 0;

            initGui();
            updateGui();
        }
        private void run()
        {
            var sq = new System.Diagnostics.Stopwatch();

            sq.Start();
            while (cpu.IsRunnung)
            {
                cpu.Fetch();
                if (StepMode != StepModeEnum.Fast)
                {
                    this.Invoke((MethodInvoker) delegate()
                    {
                        updateGui(); // runs on UI thread
                    });
                }

                cpu.Execute();
                if (StepMode != StepModeEnum.Fast)
                {
                    this.Invoke((MethodInvoker) delegate()
                    {
                        updateGui(); // runs on UI thread
                    });
                }

                if (cpu.IsRunnung && StepMode == StepModeEnum.Slow)
                {
                    System.Threading.Thread.Sleep(100);
                }
                else if (cpu.IsRunnung && StepMode == StepModeEnum.Step)
                {
                    if (MessageBox.Show("Proceed to the next step?", "Next step?", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) != System.Windows.Forms.DialogResult.Yes)
                    {
                        break;
                    }
                }
            }
            sq.Stop();
            cpu.IsRunnung = false;

            toolStripStatusLabel2.Text = "Elapsed time: " + sq.Elapsed.ToString();

            this.Invoke((MethodInvoker) delegate()
            {
                updateGui(); // runs on UI thread
            });

            // re-init for a next run
            cpu.CommandCounter = Cpu.FromShort(100);
            cpu.StepCounter    = 0;

            initGui();
        }