maux
Star on GitHub Buy me a coffee

Manual / plasm

plasm(1)

PLASM(1) General Commands Manual PLASM(1)

plasm - compile PLASMA source to a module

plasm [-[W][O[2]][N]] source [module]

Compile a PLASMA source file to a relocatable module that plasma(1) runs. This is David Schmenk's PLASMA compiler, unchanged except its load address (RELADDR $2000), built into a single executable (a "cooked" program) so it starts like any command.

With no module the output name is the source name with its extension replaced. The command line is the program's own name followed by its arguments, as on Dave's system; there is no throwaway first argument.

The source may be in either text convention: ProDOS-standard text (bare carriage return, bit 7 clear) or maux text as vi(1) and cat > write it (bit 7 set, line end $8D). Both read the same.

include inc/cmdsys.plh works from any directory. It is looked for under inc/ in the current directory first; if that fails, PLASM looks for the same name in /usr/inc (read only). Any path beginning inc/ gets this fallback, until plasm first creates or destroys a file (its output), after which it is off for the rest of the run.

Run the result with plasma module.

$ cat > hello.pla
include "inc/cmdsys.plh"
puts("Hello, world.\n")
done
^D
$ plasm hello.pla hello.mod
$ plasma hello.mod
Hello, world.

The compiler shares one 46 KB process bank with its own tables, so it can compile only SMALL programs: the code and data buffer is about 540 bytes (plasm prints it: Data+Code buffer size = $021A). A hello-world, a sieve and similar short programs fit; programs of a few hundred lines such as the PLASMA samples test.pla and rpncalc.pla stop with overflowed code table. This is an accepted limit of the 64 KB-bank design, not a fault in the source. Larger programs need the compiler built on a machine with more room.

plasm exits 0 after a compile error (this is PLASMA's own behaviour). A makefile must not trust the exit status: remove the old module first (rm -f X.mod) and list the new one after (ls X.mod). make runs recipe lines with no shell and there is no test on the release disk; ls succeeds when the module exists and fails, stopping make, when it does not. A lesson makefile is therefore:

all:
<tab>rm -f hello.mod
<tab>plasm hello.pla hello.mod
<tab>ls hello.mod

A source or output name longer than 31 characters overflows plasm's own name buffers (an upstream defect); keep names short. The command line as a whole is limited to 127 characters (rt: command line too long).

/bin/plasm
the compiler.
/usr/inc/cmdsys.plh
the PLASMA runtime header, Dave's file with maux line ends.
/mnt/MAUX/PLRT, /mnt/MAUX/PLLIB
the runtime and support modules plasma needs to run a compiled module.
/usr/man/PLASM
this page

plasma(1), nas(1)

Errors are printed with the source line and a caret. Exit status is 0 even after an error (see LIMITS). A command line longer than 127 characters is refused with status 2.

Only small programs fit (see LIMITS). The optimizer module is not available in the cooked compiler, so the -O option prints "Optimizer disabled".

October 22, 2026 maux