Example #1
0
        private static string DisassembleEmulatorBusSource(MicroInstruction instruction, out bool loadS)
        {
            EmulatorBusSource bs = (EmulatorBusSource)instruction.BS;

            switch (bs)
            {
            case EmulatorBusSource.ReadSLocation:
                loadS = false;

                if (instruction.RSELECT == 0)
                {
                    return("M");
                }
                else
                {
                    return(String.Format("$S{0}", Conversion.ToOctal((int)instruction.RSELECT)));
                }

            case EmulatorBusSource.LoadSLocation:
                loadS = true;
                return(String.Empty);

            default:
                loadS = false;
                throw new InvalidOperationException(String.Format("Unhandled Emulator BS {0}", bs));
            }
        }
Example #2
0
            protected override ushort GetBusSource(MicroInstruction instruction)
            {
                EmulatorBusSource ebs = (EmulatorBusSource)instruction.BS;

                switch (ebs)
                {
                case EmulatorBusSource.ReadSLocation:
                    if (instruction.RSELECT != 0)
                    {
                        return(_cpu._s[_rb][instruction.RSELECT]);
                    }
                    else
                    {
                        // "...when reading data from the S registers onto the processor bus,
                        //  the RSELECT value 0 causes the current value of the M register to
                        //  appear on the bus..."
                        return(_cpu._m);
                    }

                case EmulatorBusSource.LoadSLocation:
                    // "When an S register is being loaded from M, the processor bus receives an
                    // undefined value rather than being set to zero."
                    _loadS = true;
                    return(0xffff);          // Technically this is an "undefined value," we're defining it as -1.

                default:
                    throw new InvalidOperationException(String.Format("Unhandled bus source {0}", instruction.BS));
                }
            }
Example #3
0
            protected override ushort GetBusSource(MicroInstruction instruction)
            {
                //
                // The Trident tasks are wired to be RAM-enabled tasks so they can use
                // S registers.
                // This code is stolen from the Emulator task; we should REALLY refactor this
                // since both this and the Orbit Task need it.
                //
                EmulatorBusSource ebs = (EmulatorBusSource)instruction.BS;

                switch (ebs)
                {
                case EmulatorBusSource.ReadSLocation:
                    if (instruction.RSELECT != 0)
                    {
                        return(_cpu._s[_rb][instruction.RSELECT]);
                    }
                    else
                    {
                        // "...when reading data from the S registers onto the processor bus,
                        //  the RSELECT value 0 causes the current value of the M register to
                        //  appear on the bus..."
                        return(_cpu._m);
                    }

                case EmulatorBusSource.LoadSLocation:
                    // "When an S register is being loaded from M, the processor bus receives an
                    // undefined value rather than being set to zero."
                    _loadS = true;
                    return(0xffff);          // Technically this is an "undefined value," we're defining it as -1.

                default:
                    throw new InvalidOperationException(String.Format("Unhandled bus source {0}", instruction.BS));
                }
            }