Skip to Content

PASTA/80

PASTA/80 is a Pascal compiler (Turbo Pascal 3.0 dialect) for Z80 machines. Once you have told Klive where it is, Klive builds .pas files with it and runs the result on the emulated machine.

Applies to: ZX Spectrum 48K, 128K, +2A/+3, +2E/+3E, Timex, Scorpion (the pasta-80 template), and the ZX Spectrum Next.

⚠️

PASTA/80 uses SjasmPlus as its assembler backend. You must install and configure SjasmPlus in Klive before setting up PASTA/80. See the SJASMPLUS Integration page for instructions.

Prerequisites

1. Install SjasmPlus

PASTA/80 does not assemble the generated Z80 code itself: it delegates that step to SjasmPlus . Install SjasmPlus and note its installation folder.

2. Configure SjasmPlus in Klive

Set up SjasmPlus with the SJASMPLUS Integration dialog (Settings › Integrations, Configure… next to SjasmPlus), or with the sjasmp-reset command (alias sjasmpr) at the command prompt, passing the SjasmPlus installation folder:

sjasmp-reset /usr/local/bin

Klive appends the sjasmplus executable name to this path. sjasmplus describes both ways.

3. Install PASTA/80

Install PASTA/80 as its own documentation describes, and note the folder that holds its pasta executable.

Setting up PASTA/80 in Klive

With SjasmPlus already configured, run the pasta80-reset command (alias p80r) at the command prompt, passing the folder that holds the pasta executable:

pasta80-reset <full path to the pasta80 installation folder>

For example:

pasta80-reset /usr/local/bin

Klive stores only the folder; it adds the executable name, pasta, when it runs the compiler.

The command will:

  1. Verify that SjasmPlus is configured (and stop with an error if it is not).
  2. Store the PASTA/80 folder in your user settings (or, with -p, in the project).
  3. Check whether ~/.pasta80.cfg exists:
    • If not, it creates a minimal ~/.pasta80.cfg containing the correct assembler path pointing to your SjasmPlus executable and prints a confirmation message.
    • If it does exist, it reads the assembler setting and warns you if it does not match the SjasmPlus path that Klive has configured.
💡

The command saves the folder in your user settings. Use the -p switch to save the setting into the currently open project instead of globally:

pasta80-reset /usr/local/bin -p

To remove all PASTA/80 settings from Klive, run the command without arguments:

pasta80-reset

Compiler settings

These settings control PASTA/80 compilation. Change them with the set command (add -p to keep a value in the project only), for example set pasta80.opt true.

Setting keyTypeDescription
pasta80.installFolderstringThe folder that holds the pasta executable (pasta80-reset sets it)
pasta80.optbooleanEnable the peephole optimiser (--opt)
pasta80.depbooleanEnable dependency (smart-link) analysis, which strips unused code (--dep)
pasta80.ovrbooleanEnable bank-switched overlays (--ovr); always on for the 128K target
pasta80.releasebooleanLeave out Assert and Debug breakpoint code (--release)

The target follows the machine

Klive picks PASTA/80’s target from the machine the project runs on; there is no setting for it.

MachineTargetLoad address
ZX Spectrum 128K, +2A/+3, +2E/+3Ezx128 (with overlays)$8000 (32768)
ZX Spectrum Nextzxnext$8000 (32768)
Any other machinezx48$8000 (32768)

The 16K Spectrum is refused: PASTA/80 code starts at $8000, beyond its memory.

💡

With overlays the addressable limit is lower: $C000 for zx128 and $E000 for zxnext.

Using PASTA/80

After completing the setup, create a project with the pasta-80 template; its build root is main.pas. In any other project, add a .pas file and promote it to the build root.

When you build, PASTA/80 compiles the Pascal source to a raw binary and Klive injects it into the emulator at the target’s load address (the entry point is always the first byte of the binary: a jp __init instruction generated by the runtime).

Troubleshooting

SymptomLikely causeFix
“SjasmPlus is not configured” on pasta80-resetsjasmp-reset has not been runRun sjasmp-reset first
“sjasmplus: command not found” during compilationSjasmPlus is not on PATH and ~/.pasta80.cfg is missing or wrongCheck ~/.pasta80.cfg; the assembler key must point to the full path of the sjasmplus executable
“pasta80 did not produce an output binary”Compilation errors; check the Build output paneFix the errors shown in the output pane
Warning about mismatched assembler path~/.pasta80.cfg was edited manually and differs from Klive’s SjasmPlus settingUpdate ~/.pasta80.cfg or re-run sjasmp-reset to align the paths

The editor colours Pascal source, but it has no breakpoints for .pas files. To follow a running program, pause it and use the Disassembly view.

Last updated on