Skip to content
Standard Forth system for ZX Spectrum 128 and compatible computers, with disk drives.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
backgrounds
bin
disks
doc
make
screenshots
src
tmp
tools
vim
.gitattributes
.gitignore
ACKNOWLEDGMENTS.adoc
LICENSE.txt
Makefile
Makefile.pasmo
README.adoc
TO-DO.adoc
VERSIONS.adoc

README.adoc

Solo Forth

Description

Solo Forth is a modern standard Forth system under development for the ZX Spectrum 128 and compatible computers, with disk drives and a supported DOS: +3DOS, G+DOS, or TR-DOS.

Solo Forth can not run on the original ZX Spectrum 48, but it may be used to develop Forth programs for that machine.

Solo Forth can be used as a stand-alone Forth system on a ZX Spectrum emulator or the real computer. Nevertheless, its goal is the cross development of Forth programs using a ZX Spectrum emulator on a GNU/Linux operating system (in theory, other type of operating system could be used as well).

Main features

  • Fast DTC (Direct Threaded Code) implementation.

  • A kernel as small as possible.

  • Name space in banked memory, separated from code and data space.

  • Transparent access to banked memory.

  • Big library of useful source code.

  • Modular DOS support.

  • Fully documented source code.

  • Detailed documentation.

Minimum requirements

  • 128 KiB RAM.

  • One double-sided 80-track disk drive (two or three recommended, depending on the DOS).

History and current status

The development of Solo Forth started on 2015-05-30, from the disassembled code of Abersoft Forth, a tape-based fig-Forth 1.1 for ZX Spectrum 48.

The GitHub repository was created on 2016-03-13 from the development backups, in order to preserve the change history from the very beginning. Besides, there’s a development history until v0.12.0 (2016-12-31).

At the time of writing, Solo Forth is under active development. It’s very stable, and it’s being used to develop two projects in Forth: Nuclear Waste Invaders and Black Flag.

Platforms

Table 1. Supported platforms
Computer Disk interface DOS

Pentagon 1024

TR-DOS

Pentagon 128

TR-DOS

Pentagon 512

TR-DOS

Scorpion ZS 256

TR-DOS

ZX Spectrum +2

Beta 128

TR-DOS

ZX Spectrum +2

Plus D

G+DOS

ZX Spectrum +2A

(External disk drive)

+3DOS

ZX Spectrum +2B

(External disk drive)

+3DOS

ZX Spectrum +3

+3DOS

ZX Spectrum +3e

+3DOS

ZX Spectrum 128

Beta 128

TR-DOS

ZX Spectrum 128

Plus D

G+DOS

Porting the G+DOS version of Solo Forth to its close relatives GDOS, Beta DOS and Uni-DOS would require only minor changes, beside adding some library code to support their specific features.

Supporting IDEDOS, ResiDOS, esxDOS or NextOS will let Solo Forth use hard drives, flash cards, and a lot of memory.

Table 2. Planned supported platforms
Computer Disk interface DOS Priority

ZX Evolution TS-Conf

TR-DOS

Low

ZX Spectrum +3e

divIDE/ZXATASP/ZXCF/ZXMMC…​

IDEDOS

Medium

ZX Spectrum +3e

divIDE/ZXATASP/ZXCF/ZXMMC…​

ResiDOS

Low

ZX Spectrum 128/+2

DISCiPLE

GDOS

Low

ZX Spectrum 128/+2

DISCiPLE/Plus D

Uni-DOS

Low

ZX Spectrum 128/+2

Plus D

Beta DOS

Low

ZX Spectrum 128/+2/+2A/+2B/+3

divIDE/ZXATSP/ZXCF/ZXMMC…​

esxDOS

Low

ZX Spectrum Next

NextOS

High

ZX-Uno

esxDOS

Low

Project directories

Directory Subdirectory Description

backgrounds

Version background images

bin

Binary files needed to build disk 0

bin

addons

Code loaded from disk, not assembled in the library yet

bin

dos

DOS files

bin

fonts

Fonts for the supported screen modes

disks

Disk images

disks

gplusdos

G+DOS disk images

disks

plus3dos

+3DOS disk images

disks

trdos

TR-DOS disk images

doc

Documentation: PDF and HTML manuals

make

Files used by make to build the system

screenshots

Version screenshots

src

Sources

src

addons

Code that is loaded from disk

src

doc

Files used to build the documentation

src

inc

Z80 symbols

src

lib

Library

src

loader

BASIC loader for disk 0

tmp

Temporary files created by make

tools

Development and user tools

vim

Vim files

vim

ftplugin

Filetype plugin

vim

syntax

Syntax highlighting

Disks

The <disks> directory of the directory tree contains the disk images:

disks/*/disk_0_boot.*
disks/*/disk_1*_library.*
disks/*/disk_2_programs.*
disks/*/disk_3_workbench.*

The subdirectory and the filename extension of every DOS are the following:

Table 3. DOS subdirectories and disk image filename extensions
DOS Subdirectory Filename extension

+3DOS

plus3dos

dsk

G+DOS

gplusdos

mgt

TR-DOS

trdos

trd

How to run

Pentagon 128

  1. Run a ZX Spectrum emulator and select a Pentagon 128[1].

  2. "Insert" the disk image file <disks/trdos/disk_0_boot.trd> as disk 'A'.

  3. Choose "TR DOS" from the computer start menu. This will enter the TR-DOS command line[2].

  4. Press the '.' key to get the RUN command and press the Enter key. Solo Forth will be loaded from disk.

Pentagon 512

  1. Run a ZX Spectrum emulator and select a Pentagon 512[1].

  2. "Insert" the disk image file <disks/trdos/disk_0_boot.pentagon_512.trd> as disk 'A'.

  3. Choose "128k menu"[3] from the computer start menu (the reset service menu). This will enter a ZX Spectrum 128 style menu. Choose "TR-DOS". This will enter the TR-DOS command line[2].

  4. Press the '.' key to get the RUN command and press the Enter key. Solo Forth will be loaded from disk.

Pentagon 1024

  1. Run a ZX Spectrum emulator and select a Pentagon 1024[1].

  2. "Insert" the disk image file <disks/trdos/disk_0_boot.pentagon_1024.trd> as disk 'A'.

  3. Choose "128k menu"[3] from the computer start menu (the reset service menu). This will enter a ZX Spectrum 128 style menu. Choose "TR-DOS". This will enter the TR-DOS command line[2].

  4. Press the '.' key to get the RUN command and press the Enter key. Solo Forth will be loaded from disk.

Scorpion ZS 256

  1. Run a ZX Spectrum emulator and select a Scorpion ZS 256[1].

  2. "Insert" the disk image file <disks/trdos/disk_0_boot.scorpion_zs_256.trd> as disk 'A'.

  3. Choose "128 TR DOS" from the computer start menu. Solo Forth will be loaded from disk.

ZX Spectrum +3/+3e

  1. Run a ZX Spectrum emulator and select a ZX Spectrum +3 (or ZX Spectrum +3e)[1].

  2. "Insert" the disk image file <disks/plus3dos/disk_0_boot.180.dsk> (or <disks/plus3dos/disk_0_boot.720.dsk>, depending on the capacity of the drive) as disk 'A'.

  3. Choose "Loader" from the computer start menu. Solo Forth will be loaded from disk.

ZX Spectrum 128/+2 with the Beta 128 interface

  1. Run a ZX Spectrum emulator and select a ZX Spectrum 128 (or ZX Spectrum +2) with the Beta 128 interface[1].

  2. "Insert" the disk image file <disks/trdos/disk_0_boot.trd> as disk A of the Beta 128 interface.

  3. Choose "128 BASIC" from the computer start menu.

  4. Type randomize usr 15616 in BASIC (or just run usr15616 to save seven keystrokes). This will enter the TR-DOS command line[2].

  5. Press the '.' key to get the RUN command and press the Enter key. Solo Forth will be loaded from disk.

ZX Spectrum 128/+2 with the Plus D interface

  1. Run a ZX Spectrum emulator and select a ZX Spectrum 128 (or ZX Spectrum +2) with the Plus D disk interface.

  2. "Insert" the disk image file <disks/gplusdos/disk_0_boot.mgt> as disk 1 of the Plus D disk interface.

  3. Choose "128 BASIC" from the computer start menu.

  4. Type run in BASIC. G+DOS will be loaded from disk, and Solo Forth as well.

How to use the library

On +3DOS

  1. Run Solo Forth.

  2. "Insert" the file <disks/plus3dos/disk_1_library.dsk> as disk B. 'b' set-drive throw to make drive 'B' the current one.

  3. Type 1 load to load block 1 from the library disk. By convention, block 0 can not be loaded (it is used for comments), and block 1 is used as a loader. In Solo Forth, block 1 contains 2 load, in order to load the need tool from block 2.

  4. Type need name, were "name" is the name of the word or tool you want to load from the library.

On G+DOS

  1. Run Solo Forth.

  2. "Insert" the file <disks/gplusdos/disk_1_library.mgt> as disk 2 of the Plus D disk interface. Type 2 set-drive throw to make drive 2 the current one.

  3. Type 1 load to load block 1 from the library disk. By convention, block 0 can not be loaded (it is used for comments), and block 1 is used as a loader. In Solo Forth, block 1 contains 2 load, in order to load the need tool from block 2.

  4. Type need name, were "name" is the name of the word or tool you want to load from the library.

On TR-DOS

  1. Run Solo Forth.

  2. "Insert" the file <disks/trdos/disk_1a_library.trd> as disk B of the Beta 128 interface, and the file <disks/trdos/disk_1b_library.trd> as disk C. Type 1 set-drive throw to make drive 1[4] the current one.

  3. Type 1 load to load block 1 from the library disk. By convention, block 0 can not be loaded (it is used for comments), and block 1 is used as a loader. In Solo Forth, block 1 contains 2 load, in order to load the need tool from block 2. Type need set-block-drives to load the word set-block-drives from the library. Then type 2 1 2 set-block-drives to configure the second and the third drives as block drives.

  4. Type need name, were "name" is the name of the word or tool you want to load from the library.

Documentation

The <doc> directory contains one version of the manual for every DOS supported, in HTML and PDF formats. The manuals are built automatically from the sources and other files. At the moment they contain a description of the Forth system, the basic information required to use it and a complete glossary with cross references.


1. Make sure the disk drives are configured as double-sided and 80-track
2. The TR-DOS command line uses keyboard tokens, like the ZX Spectrum 48, but commands typed in 'L' cursor mode will be recognized as well, as on the ZX Spectrum 128 editor. In order to get the 'L' cursor mode you can type a quote (Symbol Shift + 'P') or press 'E' to get keyword REM. When the DOS command is typed in full, the quote or the REM must be removed from the start of the line before pressing 'Enter'.
3. In theory, choosing option "TR-DOS" from the system service menu should work. But it seems it depends on a specific version of TR-DOS. This alternative method is longer, but it works with the TR-DOS 5.03 ROM. It will be improved in future versions of the manual.
4. The TR-DOS BASIC interface uses letters 'A'..'D' to identify the disk drives, in commands and filenames. But, under the hood, TR-DOS uses numbers 0..3 to identify the disk drives, and filenames don’t include the drive letter. This is the way Solo Forth works too. Usage of 'A'..'D' instead of 0..3 maybe implemented in a future version of Solo Forth, either by default or as an option.
You can’t perform that action at this time.