Ejemplo n.º 1
0
        protected void ExecuteInstruction()
        {
            try
            {
                Tick++;
                LastException      = null;
                LastProgramCounter = CurrentProgramCounter;

                if (CurrentInstruction == null)
                {
                    throw new NotSupportedException("Instruction is invalid!");
                }

                LastInstruction = CurrentInstruction;

                ExecuteOpcode(LastInstruction);

                if (Monitor.DebugOutput)
                {
                    string info = GetSourceInformation(LastProgramCounter) ?? string.Empty;

                    Debug.Write(Tick.ToString());
                    Debug.Write('\t');
                    Debug.Write(GetDump());
                    Debug.Write('\t');
                    Debug.WriteLine(LastProgramCounter.ToString("X") + ": " + LastInstruction.ToString() + '\t' + info);
                }
            }
            catch (SimCPUException e)
            {
                if (Monitor.DebugOutput)
                {
                    Debug.WriteLine("SIM: " + e.ToString());
                }
                LastException = e;
            }
            catch (NotSupportedException e)
            {
                if (Monitor.DebugOutput)
                {
                    Debug.WriteLine(e.ToString());
                }
                LastException = new SimCPUException();
                Monitor.Stop  = true;
            }
        }
Ejemplo n.º 2
0
        protected void ExecuteInstruction()
        {
            try
            {
                Tick++;
                LastException = null;
                LastProgramCounter = CurrentProgramCounter;

                if (CurrentInstruction == null)
                    throw new NotSupportedException("Instruction is invalid!");

                LastInstruction = CurrentInstruction;

                ExecuteOpcode(LastInstruction);

                if (Monitor.DebugOutput)
                {
                    Debug.Write(CompactDump());
                    Debug.Write("  0x" + LastProgramCounter.ToString("X") + ": ");
                    Debug.WriteLine(LastInstruction.ToString());
                }
            }
            catch (SimCPUException e)
            {
                LastException = e;
            }
            catch (NotSupportedException e)
            {
                LastException = new SimCPUException();
                Monitor.Stop = true;
            }
        }
Ejemplo n.º 3
0
        protected void ExecuteInstruction()
        {
            try
            {
                Tick++;
                LastException = null;
                LastProgramCounter = CurrentProgramCounter;

                if (CurrentInstruction == null)
                    throw new NotSupportedException("Instruction is invalid!");

                LastInstruction = CurrentInstruction;

                ExecuteOpcode(LastInstruction);

                if (Monitor.DebugOutput)
                {
                    string info = GetSourceInformation(LastProgramCounter) ?? string.Empty;

                    Debug.Write(Tick.ToString());
                    Debug.Write('\t');
                    Debug.Write(GetDump());
                    Debug.Write('\t');
                    Debug.WriteLine(LastProgramCounter.ToString("X") + ": " + LastInstruction.ToString() + '\t' + info);
                }
            }
            catch (SimCPUException e)
            {
                if (Monitor.DebugOutput)
                {
                    Debug.WriteLine("SIM: " + e.ToString());
                }
                LastException = e;
            }
            catch (NotSupportedException e)
            {
                if (Monitor.DebugOutput)
                {
                    Debug.WriteLine(e.ToString());
                }
                LastException = new SimCPUException();
                Monitor.Stop = true;
            }
        }