Example #1
0
        private void OutputASCIZ(SimhPDP10CPU processor, ulong ea)
        {
            var sb  = new StringBuilder();
            var eos = false;

            while (!eos)
            {
                var output = ASCIZ.Get(processor.CORE[ea]);
                foreach (var c in output)
                {
                    if (c == 0)
                    {
                        eos = true;
                        break;
                    }
                    sb.Append(c);
                }
                ea++;
            }

            if (ConsoleOutput != null)
            {
                ConsoleOutput(this, new ConsoleOutputEvent(sb.ToString()));
            }
        }
Example #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
            };
        }
Example #3
0
        public MonitorContext(SimhPDP10CPU cpu)
        {
            CPU  = cpu;
            CORE = cpu.CORE;
            AC   = cpu.AC;

            TTCALL = (TTCALL)registerUUO(OpCodes.TTCALL, new TTCALL());
            CALLI  = (CALLI)registerUUO(OpCodes.CALLI, new CALLI());
        }
        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();
        }
Example #5
0
        public InstructionExit HandleUUO(SimhPDP10CPU processor, ulong instruction, OpCodes opcode, int ac, ulong ea)
        {
            switch ((CALLIs)ea)
            {
            case CALLIs.GETTAB:
                return(GETTAB.Execute(Monitor, processor, instruction, opcode, ac, ea));

            case CALLIs.CORE:
                return(CORE.Execute(Monitor, processor, instruction, opcode, ac, ea));

            case CALLIs.EXIT:
                return(InstructionExit.IntentionalExit);

            default:
                return(InstructionExit.UnimplementedMonitorCall);
            }
        }
Example #6
0
 public InstructionFailure(
     SimhPDP10CPU cpu,
     InstructionExit exitType,
     ulong pc,
     ulong inst,
     OpCodes opcode,
     int ac,
     ulong ea,
     string message,
     Exception inner) : base(message, inner)
 {
     CPU         = cpu;
     Instruction = new Word36(inst);
     PC          = pc;
     AC          = ac;
     EA          = ea;
     Opcode      = opcode;
     ExitType    = exitType;
 }
Example #7
0
        public static InstructionExit Execute(MonitorContext monitor, SimhPDP10CPU processor, ulong instruction,
                                              OpCodes opcode, int ac, ulong ea)
        {
            var pageSize = processor.CORE.PageSize;

            // Ignore PHY for now - no physical mode anyway (we may want an emulator assert here though)

            var acV   = processor.CORE[ac];
            var hiseg = acV.LHW;
            var loseg = acV.RHW;

            // Error states

            // High and low are zero
            if (hiseg.Z && loseg.Z)
            {
                return(InstructionExit.Normal);
            }

            // Hiseg specified but not in high seg (clears - high segment, but can only be done from loseg)
            if (processor.PC >= 400000.OctU() &&
                hiseg.NZ &&
                hiseg < 400001.Oct18())
            {
                return(InstructionExit.Normal);
            }

            // Lowseg is running over the hiseg
            if (loseg.NZ &&
                loseg > 399999.Oct18())
            {
                return(InstructionExit.Normal);
            }



            processor.CORE.Tops10Core(hiseg, loseg);

            processor.PC++; // Success Exit
            return(InstructionExit.Normal);
        }
Example #8
0
        public InstructionExit HandleUUO(SimhPDP10CPU processor, ulong instruction,
                                         OpCodes opcode, int ac, ulong ea)
        {
            switch ((TTCALLs)ac)
            {
            case TTCALLs.OUTSTR:     // [TTCALL 3,] OUTPUT STRING
                OutputASCIZ(processor, ea);
                break;

            case TTCALLs.INCHRW:     // [TTCALL 0,] INPUT CHAR AND WAIT
            case TTCALLs.OUTCHR:     // [TTCALL 1,] OUTPUT CHAR
            case TTCALLs.INCHRS:     // [TTCALL 2,] INPUT CHAR AND SKIP
            case TTCALLs.INCHWL:     // [TTCALL 4,] INPUT CHAR WAIT, LINE
            case TTCALLs.INCHSL:     // [TTCALL 5,] INPUT CHAR SKIP, LINE
            case TTCALLs.GETLCH:     // [TTCALL 6,] GET LINE CHARS
            case TTCALLs.SETLCH:     // [TTCALL 7,] SET LINE CHARS
            case TTCALLs.RESCAN:     // [TTCALL 10,] RESET INPUT LINE
            case TTCALLs.CLRBFI:     // [TTCALL 11,] CLEAR INPUT BUFFER
            case TTCALLs.CLRBFO:     // [TTCALL 12,] CLEAR OUTPUT BUFFER
            case TTCALLs.SKPINC:     // [TTCALL 13,] SKIP IF CHAR IN INPUT
            case TTCALLs.SKPINL:     // [TTCALL 14,] SKIP IF LINE IN INPUT
            case TTCALLs.IONEOU:     // [TTCALL 15,] OUTPUT IMAGE CHAR

            default:
                throw new InstructionFailure(processor,
                                             InstructionExit.UnimplimentedUUO,
                                             processor.PC, instruction,
                                             opcode,
                                             ac,
                                             ea,
                                             "Unimplemented TTCALL: " + (TTCALLs)ac,
                                             null);
            }

            return(InstructionExit.Normal);
        }
Example #9
0
 public static InstructionExit Execute(MonitorContext monitor, SimhPDP10CPU processor, ulong instruction, OpCodes opcode, int ac, ulong ea)
 {
     throw new NotImplementedException();
 }