Download View/Open - CSTA Source

Transcript
2
•
B. Shelburne
into machine code that can be executed by the virtual PDP-8. PDP-8 programs can be executed
from the debug screen or executed under a simple I/O interface called the Run PDP-8 screen. The
latter requires writing PDP-8 I/O routines.
Use of the PDP-8 Emulator Program requires some understanding of PDP-8 architecture. The
PDP-8 is a 12-bit word addressable machine with a single 12-bit accumulator and 4096 words of
memory partitioned into 32 pages of 128 words each. Instructions are fixed length and are 12-bits
wide. A three-bit opcode field permits only eight instructions; although two of the eight
instructions (opcodes 6 and 7) use the other nine bits as extended opcodes. In particular opcode 7
is a family of orthogonal micro-instructions which can be combined to generate a surprisingly rich
set of operations. There are four addressing modes: zero page addressing, current page addressing
(both forms of direct addressing), indirect, and auto-index indirect. The first two reflect the
partition of memory into 32 pages of 128 words each. The last one is used to handle data
structures like strings and arrays.
The PDP-8 Emulator Program only supports the features found in a minimally configured PDP-8.
For example it only supports integer addition; other operations like multiplication and division
must be done in software. This design decision was made to keep the PDP-8 Emulator Program
simple and easy to use yet despite its simplicity the PDP-8 is elegant in its ability to implement
complex operations with a limited instruction set. A real PDP-8 had the option of including an
Extended Arithmetic Element unit that did multiplication and division in hardware.
The PDP-8 Emulator Program can accept and execute PDP-8 machine code or it can assemble and
execute PDP-8 Assembler Language (PAL) programs. Since assembler is the primary way to write
programs using the PDP-8 Emulator Program much of the following paper is a quick tutorial in
PDP-8 Assembler Language.
Why the PDP-8? The PDP-8 was introduced in 1965 and by today’s standards its architecture and
capabilities are archaic (truly a dinosaur except the PDP-8 was small). However its simple design
and low cost made the PDP-8 a very successful computer (50,000 units were produced). Because
of its simple design PDP-8 assembler is easy to understand, write, and use. Even PDP-8 machine
coding can be done without too much difficulty! Assembler languages for today’s machines have
a steep learning curve and machine code is out of the question. A toy computer simulator could
provide an easy assembler (and the capability of easy machine coding) but toy architectures are
not real. The PDP-8 Emulator Program simulates a real architecture (warts and all) that is simple