Mitch Bradley's PDP-7 Forth, with the turtle on the 340.
Type a line and press Return: 2 3 + . Draw: CS 4 0 DO 200 FD 90 RT LOOP. WORDS lists every word. DEMO shows more. Mitch's README ↗turtle words ↗
Forth and the turtle on the cabinet
A small Forth for the PDP-7 by Mitch Bradley, 2026. See PDP-7 Forth for where it came from and how it works.
Type. Click the teletype paper so it has the keyboard. Each line answers ok, or names the word it did not know with a ?. The teletype is set up for Forth: full duplex, since Forth echoes what it reads, and line input, so you edit a line with Backspace and send it with Return. WORDS fits its listing to the paper's width, because the teletype tells Forth how wide it is. ⚙ under the paper shows the settings and the font size; drag the bar under the paper to make it taller.
2 3 + .
4 0 DO 200 FD 90 RT LOOP
: SQ 4 0 DO 200 FD 90 RT LOOP ;
: FLOWER 8 0 DO SQ 45 RT LOOP ;
CS FLOWER
The turtle words: FD BK (pixels), RT LT (degrees, clockwise is right), PU PD pen up and down, CS clear the screen, HOME, HT ST hide and show the turtle. WORDS lists the whole dictionary.
Demo reboots and types the pdp7forth README's turtle session: a square, a flower, a star.
Mitch Bradley wrote this Forth in 2026 for the machine UNIX was born on: 18-bit words, 8K of core, no bytes. Each cell of a colon definition is a PDP-7 instruction that the inner interpreter runs with xct, so NEXT is three instructions, and a word's kind is in its opcode bits. The turtle is Forth source, loaded from paper tape, that writes the 340's display list as it moves.
Mitch builds it with pdp7-unix's as7 assembler and compiles the Forth prelude by running the kernel under SIMH. The emulator takes the kernel as7 assembled and does the SIMH step itself, in the page: it feeds prelude.fs and turtle.fs to the emulated paper tape reader and keeps the core. The next step is to assemble the kernel in the page too, so its source can be edited and rerun.
Source: github.com/MitchBradley/pdp7forth, MIT licence.
packages/cabinet/tapes/pdp7forth/README.md GitHubLoading…