PDP-8 Assembler
(Click here for a Romanian translation of this page, courtesy of Aleksandra Seremina at Azoft)
pdpnasm is an assembler for the PDP-8 computer, written in C. It follows the standard PAL-III syntax, with some exceptions, and was intended to be backwards-compatible with Prof. Wolf's assembler as used in ELE 375 (Fall 06). Advantages over the previous assembler include:
- More robust; catches more errors and gives sensible error messages.
- Closer to the original PAL-III specification.
- Much more flexible with whitespace.
- Same code handles both passes.
- Simpler instruction encoding using the "Fixed Symbol Table"-approach.
To use:
- Run
maketo buildpdpnasm(works in UNIX or Cygwin). - Run
pdpnasm asm-file.p8 obj-file.po(same usage as the originalpdp8asmof ELE 375).
fixtab.p8 contains the fixed symbol table, that is, the definition of mnemonics such as TAD and CLA, and must be present in the current directory when assembling. This methodology is analogous to how the original PAL-III assembler worked, having instruction mnemonics as a special case of user-defined symbols.
Download pdpnasm.zip (UNIX source code and Makefile).
Missing features
General
- Have error messages point to beginning of faulting token instead of current input position.
- Automated testing.
Deliberate deviations from specification
- Junk (characters except whitespace) not accepted after
$. - "Ignored Characters" are not ignored; may trigger errors instead.
- "Illegal Characters" are not ignored; will trigger errors instead.
- Integer literals need not fit in a single word as long as the overall expression does so.
- All characters of a symbol name are used for identification; not just the first six.
- Recursive assignments not supported (e.g. "
EXIT=RETURN=JMP I 0") - Symbol redefinitions or assignments are treated as errors.
- Symbol table is not printed at end of Pass 1.
FIXMRImay be used anywhere in the code (not just immeditately after anEXPUNGE).- Error messages may not be phrased exactly as in the specification.
Currently unimplemented features from specification
OCTAL,DECIMAL.PAUSE,FIELD.EXPUNGE,FIXTAB.- Fixed symbol table does not yet contain all specified symbols.
- Optional
Ztoken not supported (do some error checking here, too).
The PAL-III specification can be found here.