pz80 -- a native assembler for the PSA Macro Assembler dialect, writing
Microsoft REL

Copyright (c) 2026, Robert Cousins.  SPDX-License-Identifier: BSD-2-Clause

What it is

  TurboDOS was written for PASM 2.00, Phoenix Software Associates' macro
  assembler, and its object modules were converted to Microsoft REL with
  Software 2000's RELCVT before GEN linked them.  pz80 reads that source
  and writes the REL file directly, in the shape RELCVT gave it, so a
  module assembled here compares item for item with one that went through
  PASM and RELCVT on a TurboDOS machine -- which is the test the package
  runs, against PASM 2.00 itself on the tdosbox emulator.

  The dialect is PASM's own: period-prefixed pseudo-operations, the
  Intel-extended mnemonics (MOV, LXI, JMPR, DADX) with the Zilog set under
  .ZOP, seven-level expressions with < > as shifts and @ as remainder, a
  relocation model of n times one base, bracketed conditionals that span
  lines, and text macros with created symbols, temporaries, .GOTO and
  subscripted arguments.  SPEC.md says what each of these does and where
  PASM 2.00 departs from its 1980 manual.

Building

  make            needs ../librel, as the other REL_tools programs do
  make test       the golden objects, the must-refuse cases, the command line
  make oracle     the same cases through PASM 2.00 + RELCVT on the emulator
                  (needs ~/claude/tdosbox); writes tests/out/oracle
  make install    PREFIX, DESTDIR, CC and CFLAGS are honoured

Using it

  pz80 [-mnv] [-o file.rel] [-l file.prn] [-I dir] file.asm

  -I dir   where .INSERT files are looked for, after the current directory
  -l       a listing in PASM's layout, with the symbol table
  -m       MACRO-80's object shape (for LINK-80) instead of RELCVT's
  -n       no object file
  -o       the object file; default: the source's stem with .rel

  pz80(1) has the rest, and the error letters, which are PASM's.

Files

  pz80.h       types and interfaces
  main.c       options, passes, files
  asm.c        the statement, every pseudo-operation, macros, conditionals
  src.c        the stream stack: file, .INSERT, expansion, conditional text
  lex.c        the scanner: symbols, numbers, string values, bracket texts
  expr.c       expressions and the relocation rules
  enc.c        the Intel-form and Zilog-form machine operations
  emit.c       the REL object file
  sym.c        symbols, local regions, relocation bases
  list.c       the listing
  tests/       run.sh, oracle.sh, oracle.py; the cases in oracle/, bad/,
               golden/
