Ejemplo n.º 1
0
 private void RunCPUNewThread()
 {
     try
     {
         HandleHalt(CPU.ProcessorMainloop());
     }
     catch (InstructionFailure ex)
     {
         Invoke(new MethodInvoker(() =>
                                  MessageBox.Show(this,
                                                  "Processor Exited with Error " + ex.ExitType + " / " +
                                                  ex.Message
                                                  + " at PC:" + ex.PC.ToOctal(6),
                                                  "CPU Fault", MessageBoxButtons.OK, MessageBoxIcon.Stop)));
     }
     //catch (Exception ex)
     //{
     //    Invoke(new MethodInvoker(() =>
     //                             MessageBox.Show(this, "Processor Exited with Unknown Error " + ex.Message,    + " at PC:" + ex.PC.ToOctal(6)
     //                                             "CPU Fault", MessageBoxButtons.OK, MessageBoxIcon.Stop)));
     //}
     finally
     {
         Invoke(new MethodInvoker(() =>
         {
             var gr = FindGridRow(CPU.PC);
             SelectGridRow(gr);
         }));
     }
 }
Ejemplo n.º 2
0
        private bool runCPU()
        {
            CycleStart  = cpu.InstructionsExecuted;
            cpu.Runmode = RunModes.FreeRun;

            // Start at .JBSA
            cpu.PC = cpu.CORE[(int)JOBDAT._JBSA].UL;
            if (cpu.PC < 140.OctU())
            {
                cpu.PC = 30001.OctU(); // Assumption for diagnostics
            }
            if (DiaMon)
            {
                cpu.PC = 30010.OctU();
            }

            var procStat = cpu.ProcessorMainloop();

            var cyclesRun = cpu.InstructionsExecuted - CycleStart;

            switch (procStat)
            {
            case InstructionExit.BreakPoint:
                tops10.TTCALL.OUTSTRline("[Breakpoint Reached at PC:" + cpu.PC.ToOctal(6) +
                                         " <Cycles " + cyclesRun + ">" + "]");
                return(true);

            //case InstructionExit.SingleStep:
            //    TOPS10.TTCALL.OUTSTRline("[SingleStep]");
            //    return true;
            case InstructionExit.IntentionalExit:
                tops10.TTCALL.OUTSTRline("[Exit " + " <Cycles " + cyclesRun + ">]");
                return(true);

            default:
                tops10.TTCALL.OUTSTRline("?Program Exited: " + procStat + " at PC:" + cpu.PC.ToOctal(6) +
                                         " <Cycles " + cyclesRun + ">");
                return(false);
            }
        }