PAL-8 Assembler for the PDP-8/E Simulator


The PDP-8/E Simulator distribution contains the PAL-8 compatible cross assembler of Douglas W. Jones. For PDP-8/E Simulator 2.x, this is the command line binary “pal” to be executed in a Unix shell; for PDP-8/E Simulator 1.x, it is the “classic” Mac application “PAL-8 Assembler”.

The following notes assume that you are somewhat familiar with PDP-8 assembler programming.

Pseudo operators supported by the assembler

Pseudo operator        Meaning
DECIMAL Interpret all following numbers as decimal.
OCTAL Interpret all following numbers as octal. This is the default.
ZBLOCK n Output a block of n zero words.
PAGE Advance origin to next page.
PAGE n Advance origin to page n (0 ≤ n ≤ 037).
TEXT t Output the text t as 6-bit packed ASCII. t is a text, started and ended with the same delimiting character, e. g. /TEXT/. When the text has an odd number of characters, a 6-bit zero character is appended, else a 12-bit zero word.
EJECT Eject a page in the listing. The Macintosh PAL-8 Assembler simply draws a horizontal ruler.
FIELD n Set origin to location 0200 in field n. Not available when creating RIM output.
NOPUNCH Causes the assembler to continue processing the input, but not to create corresponding binary output.
ENPUNCH Turns code generation on again after it was turned off by NOPUNCH.
XLIST Toggles the mode of listing generation: on or off.
XLIST e When the constant expression e evaluates to zero, turn listing off, else on.
IFZERO e < stmts > When the constant expression e evaluates to zero, assemble all assembler statements stmts contained in the matching angle brackets < >, else ignore them. (When using conditional assembly, don’t use < or > in comments. Conditions may be nested.)
IFNZRO e < stmts > When the constant expression e evaluates not to zero, assemble all assembler statements stmts contained in the matching angle brackets < >, else ignore them.
IFDEF s < stmts > When the symbol s is defined, assemble all assembler statements stmts contained in the matching angle brackets < >, else ignore them.
IFNDEF s < stmts > When the symbol s is not defined, assemble all assembler statements stmts contained in the matching angle brackets < >, else ignore them.
RELOC n Start to assemble code that can execute after it is relocated (moved) to address n.
SEGMNT Like PAGE, but with page size of 1K words.
SEGMNT n Like PAGE n, but with page size of 1K words.
BANK Like FIELD, but select a different 32K bank out of 128K. Not supported and produces an error.
FIXMRI s=e Define the new memory reference mnemonic s with the value of the constant expression e.
EXPUNGE Removes all symbols (except the pseudo operators) from the permanent symbol table. They stay removed until the PAL-8 Assembler is restarted from the Finder.
FIXTAB Append all presently defined symbols to the permanent symbol table. They stay appended until the PAL-8 Assembler is restarted from the Finder.
I Used for indirect addressing in memory reference instructions.
Z Optionally used for page zero addressing in memory reference instructions.

Memory reference instructions in the permanent symbol table

AND, TAD, ISZ, DCA, JMS, JMP

Goup 1 operate instructions in the permanent symbol table

NOP, CLA, CIA, CLL, CMA, CML, ICA, BSW, RAR, RAL, RTR, RTL, STA, STL, GLK, LAS

Goup 2 operate instructions in the permanent symbol table

SMA, SZA, SNL, SKP, SPA, SNA, SZL, OSR, HLT

IOT instructions in the permanent symbol table

KCC, KSF, KRS, KRB, IOT, ION, IOF, CDF, CIF, RDF, RIF, RIB, RMF, TSF, TCF, TPC, TLS, RSF, RRB, RFC, PSF, PCF, PPC, PLS

The symbol table provides place for 2047 symbols, including the pseudo operators and the predefined mnemonics. Note that the user cannot redefine symbols in the permanent symbol table. (Only the EXPUNGE and FIXTAB pseudo operators affect later assembler runs when the assembler is not quit in the meantime.)

Other special symbols meaningful to the assembler

Symbol    Meaning
/ Start of comment. The rest of the current line is ignored.
*n Set origin (current location counter) to n.
. Value of the current location counter.
s=e Define the symbol s with the value of the constant expression e.
s, Define the symbol s with the value of the current location counter. Used to define labels.
[e] Create indirect addressed page zero literal with the value of the constant expression e. The closing ] is optional. Example: TAD [333]
(e) Create indirect addressed current page literal with the value of the constant expression e. The closing ) is optional.
"x Single character literal. Evaluates to the ASCII code of the character x.
; Instruction separator. Used to separate instructions written on one line which are not to be microprogrammed.
- Unary (sign) and binary subtraction operator used in constant expressions.
+ Binary addition operator used in constant expressions.
^ Multiplication operator used in constant expressions.
% Divison operator used in constant expressions.
& Logical AND operator used in constant expressions.
| Logical OR operator used in constant expressions.
$ Signals the end of input. All text following this symbol is ignored by the assembler.

Notes for the “classic” Mac application “PAL-8 Assembler”

Before using the assembler, you might want to set some preferences for it. Double-click the assembler icon and open the “Preferences” dialog box. You can configure it to use Apple Events to communicate with a text editor of your choice and the PDP-8/E Simulator to load listings and binary programs automatically after assembly. To assemble PAL-8 sources, simply drop the source file onto the assemblers icon. When assembling large files, you can type command-period to abort the current job (the assembler continues with the next file when you have dropped more than one file onto the assemblers icon). When the assembler detects any error in the source file, the binary output paper tape is removed after completion of the assembler run. The PAL-8 source file “Welcome! (PAL Source)“ is provided for a first experiment with the assembler.