Exemplo n.º 1
0
        public Processor(RealMemory realMemory, ChannelTool channelTool, VirtualMemory virtualMemory = null, Pager pager = null)
        {
            RealMemory           = realMemory;
            VirtualMemory        = virtualMemory;
            ChannelTool          = channelTool;
            Pager                = pager;
            FileManager          = new FileManager(RealMemory, this);
            CommandInterpretator = new CommandInterpretator(this, virtualMemory);
            Interruptor          = new Interruptor(this, virtualMemory, FileManager, RealMemory);

            // STOPS PROGRAM AFTER MAX STEP COUNT
            UseMaxStep = true;
            // CURRENT STEP
            CurrentStep = 0;

            registers = new Dictionary <string, Register>
            {
                { "R1", new Register(value: 0) },                                           // Word length general register
                { "R2", new Register(value: 0) },                                           // Word length general register
                { "IC", new HexRegister(2) },                                               // Current command adress in memory register
                { "PTR", new HexRegister(4) },                                              // Page table adress register
                { "SF", new StatusFlagRegister() },                                         // Aritmetic operation logic values
                { "MODE", new ChoiceRegister('N', 'S') },                                   // Processor mode "N" - user, "S" - supervisor
                { "PI", new ChoiceRegister(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) },     // Program interuptor
                { "SI", new ChoiceRegister(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12) },     // Supervisor interuptor
                { "TI", new HexRegister(Utility.TIMER_VALUE, 1) }                           // Timer interuptor
            };
        }
Exemplo n.º 2
0
 public RealMachine(Input inputHandler = null, Output outputHandler = null)
 {
     RealMemory     = new RealMemory();
     ExternalMemory = new ExternalMemory();
     InputHandler   = inputHandler;
     OutputHandler  = outputHandler;
     ChannelTool    = new ChannelTool(RealMemory, ExternalMemory, InputHandler, OutputHandler);
     Processor      = new Processor(RealMemory, ChannelTool);
     ChannelTool.SetProcessor(Processor);
     VirtualMemory = null;
     Pager         = null;
 }
Exemplo n.º 3
0
 public void ExecuteChannelToolXCHGCommand() => ChannelTool.XCHG();
Exemplo n.º 4
0
 public void SetChannelToolRegisterValues(int SB, int DB, int ST, int DT) => ChannelTool.SetRegisters(SB, DB, ST, DT);