Ejemplo n.º 1
0
 public PageFaultError(UserModeCore core, int segment, int page, ulong loc)
 {
     CORE    = core;
     Segment = segment;
     Page    = page;
     Address = loc;
 }
Ejemplo n.º 2
0
        public MarshallCPU(TextWriter outputChan, TextReader inputChan)
        {
            this.outputChan = outputChan;
            this.inputChan  = inputChan;

            if (this.outputChan != null)
            {
                this.outputChan.NewLine = CRLF;
            }

            core = new UserModeCore(false);

            cpu = new SimhPDP10CPU(core, OSTypes.Tops10)
            {
                ProcessorType = ProcessorTypes.KL10
            };

            tops10 = new MonitorContext(cpu);

            tops10.TTCALL.ConsoleOutput += TTCALL_ConsoleOutput;
            tops10.TTCALL.AttachToConsole();

            cpu.ProcFlags = 0;
            cpu.SetUserMode();

            parser = new SimpleParser {
                CPU = cpu
            };
        }
Ejemplo n.º 3
0
        public bool DoIPause(UserModeCore core, ulong PC)
        {
            switch (BreakAction)
            {
            case BreakPointActions.Pause:
                return(true);

            case BreakPointActions.PauseOnValue:
                return(pauseOnValue(core, PC));
            }
            return(false); // ?
        }
Ejemplo n.º 4
0
        public void cpuSetup()
        {
            Core = new UserModeCore(true);

            CPU = new SimhPDP10CPU(Core, OSTypes.Tops10)
            {
                ProcessorType = ProcessorTypes.KA10
            };

            CPU.PCChanged                  += CPU_PCChanged;
            CPU.LightsChanged              += CPU_LightsChanged;
            CPU.ProcFlagChanged            += CPU_ProcFlagChanged;
            CPU.EffectiveAddressCalculated += CPU_EffectiveAddressCalculated;

            TOPS10 = new MonitorContext(CPU);

            TOPS10.TTCALL.ConsoleOutput += TTCALL_ConsoleOutput;
            TOPS10.TTCALL.AttachToConsole();

            loader = new Tops10SAVLoader(Core, KLADEXE);

            addACs();
            addSymbols <int>(typeof(JOBDAT));

            MapCore();

            MapProperties();

            foreach (var seg in Core)
            {
                seg.MemberPageChanged += seg_MemberPageChanged;
            }

            CoreBrowser.Rows[0].Expanded = true;
            var gr = FindGridRow(loader.Transaddr.UL);

            SelectGridRow(gr);
            DecorateRow(gr, Color.Red, "Transfer Address: " + loader.Transaddr);

            CPU.PC = loader.Transaddr.UI;

            CoreBrowser.AfterRowUpdate += CoreBrowser_AfterRowUpdate;

            setUpYet = true;

            CPU.ProcFlags = 0;
            CPU.SetUserMode();
        }
Ejemplo n.º 5
0
        private bool pauseOnValue(UserModeCore core, ulong pc)
        {
            var uMem = core[ValueAddress];

            ulong v = 0;

            switch (WordType)
            {
            case BreakWords.Whole:
                v = uMem.UL;
                break;

            case BreakWords.LH:
                v = uMem.LHW.UL;
                break;

            case BreakWords.RH:
                v = uMem.RHW.UL;
                break;
            }

            switch (CompareType)
            {
            case BreakCompareTypes.EQ:
                return(v == CompareValue);

            case BreakCompareTypes.LT:
                return(v < CompareValue);

            case BreakCompareTypes.LE:
                return(v <= CompareValue);

            case BreakCompareTypes.GT:
                return(v > CompareValue);

            case BreakCompareTypes.GE:
                return(v >= CompareValue);
            }

            return(false); // ?
        }
Ejemplo n.º 6
0
        public Tops10SAVLoader(UserModeCore core, string infile)
        {
            Core = core;
            //ulong pop, fmt;
            //ulong lw = 0, hwm = 0;

            var hwmPage = 0;

            var hw = 0;

            var lw = 0;

            if (!Core.PageExists(0))
            {
                Core.NewPage(0);
            }

            // Eventually call our raw file reader for 36 bit files
            var inexe = new StreamReader(infile);

            // Read in first word of file

            while (!inexe.EndOfStream)
            {
                var rw = ReadWord(inexe);

                var lh = rw.LHW;

                var leb = rw.LHW.UL;

                if (leb == 0254000.OctU())
                {
                    /*printf("Transfer Address = %o\n",re);*/
                    Transaddr = rw.RHW;
                    break;
                }

                if (((lh & 0400000.Oct18())).NZ)
                {
                    leb |= 37777000000u.OctU();
                }

                var wordsToRead = -leb.SignE();
                var re          = Convert.ToInt32(rw.RHW.UL);

                if (wordsToRead <= 0)
                {
                    throw new Exception("?T10_LOADER - SAV Not a count! " + rw);
                }

                //Console.WriteLine("Load %d words at %o\n",-le,re+1);
                lw += wordsToRead;

                for (var i = 0; i < (wordsToRead); i++)
                {
                    var bodyw = ReadWord(inexe);

                    var adrs = re + i + 1;
                    var page = Core.Page(adrs);

                    assureCoreHwm(page, ref hwmPage);

                    Core[re + i + 1] = bodyw;

                    // printf("%o/ %o,,%o  %llo\n",re+i+1,lh,rh,blv);
                    if (re + i + 1 > hw)
                    {
                        hw = re + i + 1;
                    }
                }
            }

            Console.WriteLine("[{0} Words Loaded From {1}]", lw, infile);

            inexe.Close();

            Console.WriteLine("[End loading {0}]", infile);

            if (Transaddr.NZ)
            {
                Core[0, 0120.Oct18().UI] = new Word36((Word18)0, Transaddr);
            }

            Transaddr = Core[0, 0120.Oct18().UI].RHW;

            Hiseg_floor = 0400000.Oct18();
            High_Water  = (Word18)hw;

            Console.WriteLine("[Loader High-Water-Mark is {0}]", High_Water);
            Console.WriteLine("[Transfer address is {0} Hiseg is {1}]", Transaddr,
                              Hiseg_floor);
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            var Core = new UserModeCore();

            var loader = new Tops10SAVLoader(Core, "test.sav");
        }