Skip to content

Repository files navigation

8086 FIG-FORTH — Modified Bootable/DOS Build

This repository preserves my personal 8086 FIG-FORTH system, modified mainly in 1995 and now packaged with modern tools for examining and rebuilding it.

The system is based on the early Forth Interest Group implementation. Source comments credit this 8086 version to Thomas Newman and Joe Smith. Later extensions include my own modifications together with code, routines, and ideas drawn from Guy Kelly's KFORTH, MVP Forth, and other public-domain or historical Forth sources where noted in the source and block files.

This is not a modern ANS Forth. It is a compact historical and experimental system for DOS-hosted operation, DOS-like emulation, and standalone boot-disk use. It provides a working example of a small threaded 8086 Forth with block storage, screen editing, vectored I/O, turnkey and simple multitasking hooks, an 8086 assembler, RAM-disk support, and a substantial block-file extension library.

Repository contents

The main archival and build files include:

  • FIGFORTH.ASM — 8086 FIG-FORTH assembly source.
  • FIGFORTH.COM — DOS-hosted executable.
  • MYFORTH.BLK — block-file extension library.
  • make_bootdisk.py — creates a bootable floppy image from a .COM file and block file.
  • blk2txt.py and txt2blk.py — convert between Forth block files and readable text listings.
  • FIGFORTH_glossary.md — glossary generated from the ;= comment lines in FIGFORTH.ASM.
  • myforth_glossary.md — glossary generated from a text conversion of MYFORTH.BLK.

Status and limitations

This is an archival and educational system intended for study, experimentation, and preservation rather than production use.

  • It does not implement the ANS Forth word set.
  • Its screen- and block-based workflow is historically accurate but unfamiliar to many modern users.
  • DOS-hosted and standalone boot-disk operation are distinct environments.
  • XBYE returns to DOS only in the DOS-hosted version.
  • The standalone boot image requires the correct OFFSET and ASET values.
  • The BLK-to-text-to-BLK conversion normalizes screen contents to space-padded 16-by-64 records. Consequently, an all-zero block may be reconstructed as an all-space block even though its displayed Forth contents are equivalent.

Its value is that it remains small, understandable, close to the machine, and representative of the practical personal Forth systems built and extended on PC-compatible hardware in the DOS era.

Quick start

The DOS-hosted version can be assembled and linked under DOSBox or a similar DOS-compatible environment.

1. Assemble and link

Obtain the JWASM assembler and VAL linker from a FreeDOS distribution.

Assemble FIGFORTH.ASM:

JWASMR -Zm -O FIGFORTH.ASM

Link the object file to create a .COM program:

VAL /co FIGFORTH.OBJ

Run the resulting program:

FIGFORTH

2. Try the base system

Inside FIG-FORTH, enter:

VLIST

Press any key to continue through the dictionary listing. Press Q to quit.

Connect the DOS block file:

DOS-BLOCKS

When prompted for a filename, enter:

MYFORTH.BLK

Then list block 1:

1 LIST

3. Load the DOS/block-file extensions

Load the FIGDOS-related extension blocks:

10 LOAD  25 LOAD

Useful words to try include:

WORDS
FIGDOS WORDS

WORDS displays the current vocabulary. FIGDOS WORDS displays the words in the FIGDOS vocabulary.

4. Save the updated DOS-hosted system

Save the current system as a new .COM file:

SAVE-FORTH

When prompted, enter a filename such as:

FIG2.COM

Exit to DOS:

XBYE

The updated system can then be run with:

FIG2

Creating a bootable image

After creating an updated .COM file, exit DOSBox and run the included Python script:

python3 make_bootdisk.py

Example session:

COM file [FIGFORTH.COM]: FIG2.COM
Block file [MYFORTH.BLK]:
Output boot image [bootdsk.img]:
Patched OFFSET line at image byte 27264: 0 OFFSET -> 29 OFFSET

Note the reported OFFSET value. The example above reports 29.

Booting the standalone system

Boot the disk image in DOSBox:

boot <dir>/bootdsk.img -l A

Replace <dir> with the path to the directory containing bootdsk.img.

After the standalone system boots, set the block-file offset to the value reported by make_bootdisk.py. For the example above:

29 OFFSET !
29 ASET !

Trying the RAM disk and native editor

After setting OFFSET and ASET, inspect the FIGDOS vocabulary:

FIGDOS WORDS

In this system, DIR lists screen 1 rather than a modern filesystem directory:

DIR

Switch to the RAM disk:

RAM:

Clear it:

CLEAR-RAM

Warning: CLEAR-RAM wipes all RAM-disk screens.

List screen 10:

10 LIST

Try a simple editing session:

0 T
P ( TEST SCREEN )
5 T
P : TEST ( -- ) ." HELLO! " CR ;
L
UPDATE
10 LOAD
TEST

This creates a small test screen, loads it, and runs TEST.

Returning to the boot disk

Return to the A: block device:

A:

Then enter:

DIR

Historical note

This system preserves a style of Forth programming centered on screens, blocks, and direct interaction with the underlying machine. Although less familiar than modern file-based Forth systems, it provides a working view of how compact early Forth environments were organized and extended by individual users.

License and provenance

The original FIG-FORTH material appears to have circulated historically as public-domain source, and no new copyright claim is made here on that material.

My modifications, additions, build scripts, generated documentation, and archival cleanup are dedicated to the public domain under CC0-1.0. Incorporated historical material retains its original public-domain or source-specific status where indicated in the source comments and block files.

See LICENSE and NOTICE.md for the complete terms and provenance statement.

About

A preserved and rebuildable 8086 FIG-FORTH hobbyist system for DOS and standalone boot-disk use, with source, block libraries, documentation, and modern Python utilities.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages