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/binKlive 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/binKlive stores only the folder; it adds the executable name, pasta, when it runs the compiler.
The command will:
- Verify that SjasmPlus is configured (and stop with an error if it is not).
- Store the PASTA/80 folder in your user settings (or, with
-p, in the project). - Check whether
~/.pasta80.cfgexists:- If not, it creates a minimal
~/.pasta80.cfgcontaining the correctassemblerpath pointing to your SjasmPlus executable and prints a confirmation message. - If it does exist, it reads the
assemblersetting and warns you if it does not match the SjasmPlus path that Klive has configured.
- If not, it creates a minimal
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 -pTo remove all PASTA/80 settings from Klive, run the command without arguments:
pasta80-resetCompiler 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 key | Type | Description |
|---|---|---|
pasta80.installFolder | string | The folder that holds the pasta executable (pasta80-reset sets it) |
pasta80.opt | boolean | Enable the peephole optimiser (--opt) |
pasta80.dep | boolean | Enable dependency (smart-link) analysis, which strips unused code (--dep) |
pasta80.ovr | boolean | Enable bank-switched overlays (--ovr); always on for the 128K target |
pasta80.release | boolean | Leave 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.
| Machine | Target | Load address |
|---|---|---|
| ZX Spectrum 128K, +2A/+3, +2E/+3E | zx128 (with overlays) | $8000 (32768) |
| ZX Spectrum Next | zxnext | $8000 (32768) |
| Any other machine | zx48 | $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
| Symptom | Likely cause | Fix |
|---|---|---|
“SjasmPlus is not configured” on pasta80-reset | sjasmp-reset has not been run | Run sjasmp-reset first |
| “sjasmplus: command not found” during compilation | SjasmPlus is not on PATH and ~/.pasta80.cfg is missing or wrong | Check ~/.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 pane | Fix the errors shown in the output pane |
Warning about mismatched assembler path | ~/.pasta80.cfg was edited manually and differs from Klive’s SjasmPlus setting | Update ~/.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.