pcodevm is an interpreter for the UCSD p-code byte machine as used with UCSD
Pascal II.1, UCSD Pascal Compiler II.0, including temporary I.5 translations.

While implementing a p-code interpreter and bios functionality, it does not
replace the system runtime library, as these are entirely available on p-code
level. Instead, the runtime library (SYSTEM.PASCAL) has to be provided
explicitely to fulfill various implicit assumptions around the p-code file
format. The runtime library in turn expects to find additional initialisation
information on the boot disk, so at least one system floppy disk image needs to
be present, too.

To run the binary PROGRAM.CODE, You would invoke pcodevm as follows:

  ./pcodevm PROGRAM.CODE SYSTEM.PASCAL --disk apple1.img

To redirect any line printer output to a printing device, e.g. "lp0", You might
add the printer option:

  ./pcodevm PROGRAM.CODE SYSTEM.PASCAL --disk apple1.img --printer /dev/lp0

If Your program makes use of apple2 specific functions, like the function
KEYPRESS, add the apple option:

  ./pcodevm PROGRAM.CODE SYSTEM.PASCAL --disk apple1.img --apple

While the previous examples show how to run a single program, it is also
possible to run the interactive operating system, too. pcodevm will detect
segment #0 in the first p-code binary stated on the command line. Instead of
executing procedure #1 in segment #1 it will now repeatedly execute the command
evaluation:

  ./pcodevm SYSTEM.PASCAL --disk apple1.img --term

Note the term option, which causes any terminal input and output to be handled
through ncurses, thus simulating various special keys, cursor positioning, etc.

While pcodevm is open source, I cannot tell about the original p-code
system, including the runtime library stuff: The UCSD Pascal system sources
have been made available recently [1], but they are said to be incomplete.
Whether the Apple Pascal binaries are still subject to restrictive copyright,
I cannot tell so far.

-- 
[1] http://invent.ucsd.edu/technology/cases/1995-prior/SD1991-807.shtml
