Esempio n. 1
0
 public WorkbenchScript1(Workbench workbench) : base(workbench)
 {
     TraceLine("WorkbenchScript1");
     _mo.LoadStateFromFile(_mo.BlaBin);
     _stackTracker = new StackTracker(_workbench);
     ConfigureStatemachine();
     _sm.Fire(Trigger.Start);
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            /*
             * using (var reader = new StreamReader( @"s:\source\repos\Robotron_2084\VirtuRoX\tmp\MemoryOperations.csv" ))
             * using (var csv = new CsvReader( reader, Thread.CurrentThread.CurrentCulture )) {
             *  _records = csv.GetRecords<RecordedMemoryOperation>().ToList();
             * }
             *
             * var bla = _records.GroupBy( info => info.Address ).Select( group => new Tuple<int, int>( group.Key, group.Count() ) ).OrderBy( x => x.Item1 );
             * _dict = bla.ToDictionary( x => x.Item1 );
             * Console.WriteLine( _dict.Count );
             * object[,] res = GetReadCounts( 224, 32 );
             * Console.WriteLine( _dict.ToString() );
             * return;
             */
            /*
             * AsmLinesWindow wnd1 = new AsmLinesWindow();
             * wnd1.ShowDialog();
             * return;
             */

            Parser.Default.ParseArguments <Options>(args)
            .WithParsed <Options>(o => {
                ConsoleTraceListener tracer = new ConsoleTraceListener();
                Trace.Listeners.Add(tracer);
                Trace.WriteLine("Main() start");

                AsmReader reader = new AsmReader(@"s:\source\repos\Robotron_2084\Disassemblies\Robotron (Apple).asm");
                //reader.Test1();

                Trace.WriteLine($"Running workbench{(o.Breakpoints ? "with" : "without")} breakpoints: -b {o.Breakpoints}");

                using (_machineOperator = new MachineOperator()) {
                    if (o.Breakpoints)
                    {
                        // _machineOperator.OnPaused += MachineOperator_OnPaused;
                        _workbench = new Workbench(_machineOperator, o);
                    }
                    else
                    {
                        _machineOperator.OnLoaded += ( MachineOperator mo ) => mo.LoadStateFromFile(mo.BlaBin);
                    }

                    //Form1 frm = new Form1();
                    //frm.Populate();
                    //frm.Show();

                    _machineOperator.ShowDialog();
                }


                Trace.WriteLine("Main() end");
                Trace.Flush();
                Trace.Listeners.Remove(tracer);
                tracer.Close();
                Trace.Close();
            });
        }
Esempio n. 3
0
        public StackTracker(Workbench workbench)
        {
            _workbench = workbench;
            MachineOperator mo = workbench._mo;

            _cpu          = mo.Machine.Cpu;
            _memory       = mo.Machine.Memory;
            _stackWrapper = new StackWrapper(mo);
        }
Esempio n. 4
0
        public void SampleTest()
        {
            Trace.Indent();

            Parser.Default.ParseArguments <Options>(new string[] { "-b -c -f" })
            .WithParsed <Options>(o => {
                using (MachineOperator machineOperator = new MachineOperator()) {
                    Workbench workbench = new Workbench(machineOperator, o);
                    machineOperator.ShowDialog();
                }
            });

            Trace.Unindent();
        }
Esempio n. 5
0
 public WorkbenchScript(Workbench workbench)
 {
     _workbench = workbench;
     _mo        = _workbench._mo;
     _logOutput = File.AppendText(@"s:\source\repos\Robotron_2084\VirtuRoC\tmp\out.log");
 }