DebugWrite() private method

private DebugWrite ( ) : void
return void
Example #1
0
        static void Main(string[] args)
        {
            // Create memory and load the program and arguments (if present).
            _mem = new MemoryController();
            if (args.Length >= 1)
            {
                _mem.LoadProgram(args[0], args.Skip(1));
            }
            else if (args.Length == 1)
            {
                _mem.LoadProgram(args[0]);
            }

            InterruptHandler interruptHandler = new InterruptHandler(_mem);

            _mappedDevices = new List <IMemoryMappedDevice>();

            // Create a memory mapped console device.
            ConsoleDevice consoleDevice = new ConsoleDevice(_mem, interruptHandler, 1048448, 128);

            _mappedDevices.Add(consoleDevice);

            KeyboardDevice keyboardDevice = new KeyboardDevice(_mem, interruptHandler, 1048319, 128);

            _mappedDevices.Add(keyboardDevice);

            DisplayDevices(_mem, _mappedDevices, interruptHandler);

            Console.WriteLine();
            Console.WriteLine("Ready. Press enter to begin...");
            Console.ReadLine();
            Console.Clear();

            // Start the keyboard device.
            keyboardDevice.StartDevice();
            _mem.DebugWrite();
            // Create the CPU and start it running.
            _cpu = new CPU(_mem, interruptHandler);
            _cpu.Run();

            Console.ReadLine();
        }
Example #2
0
        static void Main(string[] args)
        {
            // Create memory and load the program and arguments (if present).
            _mem = new MemoryController();
            if (args.Length >= 1)
            {
                _mem.LoadProgram(args[0], args.Skip(1));
            }
            else if (args.Length == 1)
            {
                _mem.LoadProgram(args[0]);
            }

            InterruptHandler interruptHandler = new InterruptHandler(_mem);

            _mappedDevices = new List<IMemoryMappedDevice>();

            // Create a memory mapped console device.
            ConsoleDevice consoleDevice = new ConsoleDevice(_mem, interruptHandler, 1048448, 128);
            _mappedDevices.Add(consoleDevice);

            KeyboardDevice keyboardDevice = new KeyboardDevice(_mem, interruptHandler, 1048319, 128);
            _mappedDevices.Add(keyboardDevice);

            DisplayDevices(_mem, _mappedDevices, interruptHandler);

            Console.WriteLine();
            Console.WriteLine("Ready. Press enter to begin...");
            Console.ReadLine();
            Console.Clear();

            // Start the keyboard device.
            keyboardDevice.StartDevice();
            _mem.DebugWrite();
            // Create the CPU and start it running.
            _cpu = new CPU(_mem, interruptHandler);
            _cpu.Run();

            Console.ReadLine();
        }