Exemplo n.º 1
0
        protected void HandleGo()
        {
            int  count = 0;
            bool going = true;

            while (running && going)
            {
                try
                {
                    int time = cpu.Execute();
                    count += time;
                    int addr = cpu.GetPC();
                    if (breakpoints.Contains(addr))
                    {
                        writer.WriteLine("BREAKPOINT");
                        going = false;
                    }
                }
#pragma warning disable CA1031 // Do not catch general exception types
                catch (Exception e)
                {
                    writer.Write(e.StackTrace);
                    going = false;
                }
#pragma warning restore CA1031 // Do not catch general exception types
            }

            writer.WriteLine("[Consumed {0} ticks]", count);
        }