Exemple #1
0
        private void DoIOT()
        {
            //
            // Dispatch the IOT instruction to the correct device, if one is registered.
            // We use the Data field (the full 9 bits including the device and IOP code)
            // as the index.  See the comments in IIOTDevice for the reasoning here.
            //
            // We special case IOT 60 here -- this does not appear in any documentation but it does
            // show up in the 2nd-stage loader on a number of tapes as the first instruction.
            // Unsure what the purpose is (there are some hints that doing an IOT (any IOT) is needed to
            // trigger something) but ignoring it works fine for now.
            //
            if (_currentInstruction.Data == 0x30)
            {
                return;
            }

            IIOTDevice device = _iotDispatch[_currentInstruction.Data];

            if (device != null)
            {
                device.ExecuteIOT(_currentInstruction.Data);
            }
            else
            {
                Trace.Log(LogType.Processor, "Unimplemented IOT device {0}, IOT opcode {1}", Helpers.ToOctal((ushort)_currentInstruction.IOTDevice), Helpers.ToOctal(_currentInstruction.Data));
            }
        }
Exemple #2
0
        public Processor(ImlacSystem system)
        {
            _system = system;
            _mem    = _system.Memory;

            _iotDispatch = new IIOTDevice[0x200];   // 9 bits of IOT instructions

            Reset();
            InitializeCache();
        }
Exemple #3
0
        public void RegisterDeviceIOTs(IIOTDevice device)
        {
            int[] handledIOTs = device.GetHandledIOTs();

            foreach (int i in handledIOTs)
            {
                if (_iotDispatch[i] == null)
                {
                    _iotDispatch[i] = device;
                }
                else
                {
                    // We have an overlap here; can't have two devices sharing the same
                    // IOT.  It would be bad.
                    throw new InvalidOperationException(String.Format("IOT conflict on {0:x3} between {1} and {2}.", i, _iotDispatch[i], device));
                }
            }
        }