Repository navigation
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
timberwoof/PDP11 Introduction ============ This document describes the timberwoof/PDP11 project. timberwoof/PDP11 is an attempt to write, independently of any existing code influencess, an emulator for the basic PDP/11 instruction set. The target is a simple 16-bit PDP-11/03. The environment is Python 3. Testing is done by running unit tests under Pytest and by running various published machine-code examples including the DEC boot rooms. Modules ======= pdp11.py ------- Startup instruction dispatch processor loop pdp11_hardware.py ------------- Contains various "hardware" classes. They have dependencies, so the class pdp11CPU references and initializes them all. registers implements the register file. Provides access primitives that implement various PDP11 ways of doing things. ram implements byte-addressible RAM. Provides access primitives and two convenience functions, octal-to-decimal conversion and to read an assembled assembly file into RAM. Provides one io device, the serial output. psw implements the Processtor Status Word. Does some initializations and provides access primitives. Provides a neat way to set the PSW after instructions. Calls resemble PDP-11 processor handbook notation. stack implements the stack. Does some initializations and provides access primitives. Implements built-in pdp11 stack operations and limit checks. addressModes implements the 8 standrad address modes of the PDP11 instruction set. pdp11_boot.py ------------ convenience library for loading programs from code or file into pdp-11 ram. Sets up the instruction dispatch tables Reads the (hard-coded for now) assembly file into ram. Starts the processor loop. Instruction Classes ------------------- Instruction methods are grouped by type into these classes: pdp11_br_ops.py - branch instructions pdp11_cc_ops.py - condition codes pdp11_noopr_ops.py - no-operand instructions pdp11_other_ops.py - other instrucutions pdp11_rss_ops.py - RSS double-operand instructions pdp11_ss_ops.py - SS single-operand instructions pdp11_ssdd_ops.py - SSDD double-operand instructions pdp11SingleOperandOps.py - single-operand instructions Peripherals ----------- pdp11_console.py - PySimpleGui control switches and fun prpogram counter lights pdp11_dl11.py - serial interface pdp11_m9301.py - DEC boot rom and diagnostics pdp11_rk11.py - hard disk interface (stubbed out; not implemented) pdp11_vt52.py - PySimpleGui terminal Pytest ====== The classes named test_*.py are pytest modules. Each one, of course, is responsible for some class or set of instructions. Installation ============ Grab the repository. Open it in your favorite IDE. Ultimately runpdp11.py will start the whole thing. Current State of the Project ============================ Runs Hello World project. DL11 emulator is mostly running. M9301 emulator is running. Runs much of test_M9301_YA. Console emulator is weird. Pytest tests pass and must continue to run. GitHub project includes unit tests. To Do ===== Proper logging with settable log levels. Get a virtual disk running (RK11), Get a small OS running. mini-unix (no MMU needed) Get PacMan or Space Wars running PDP11 MMU FP-11 Implement ODT https://gunkies.org/wiki/QBUS_CPU_ODT