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. Rings: RSAVINS S" SQUARE" NAMED, then RSAVINS .RING, and open RINGS. 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.
Names. A name keeps every letter, up to 31, in SIXBIT, three letters to a word. Each word is laid out the way Open Firmware lays one out: the name, then the header, then the body. The cabinet's Forth is kernel-names-full.s, made from Mitch's kernel.s, which stays beside it in packages/cabinet/tapes/pdp7forth/ as the reference the tests compare against; VARIANTS.yml says what differs. CREATE DOES> works as in Open Firmware: : KONST CREATE , DOES> @ ; then 42 KONST ANSWER ANSWER .
PIXIE rings. RSPPIX, the 1969 ring structure processor that PIXIE's SYMELEC is built on, runs inside this Forth, its 1972 code unchanged. Each of its routines is a Forth word (RSETUP RFEL RINSRT RCAR RCDR RADDW RDELB and the rest), and pixie.fs builds on them. Open RINGS to watch the structure in 3D as you type:
RSAVINS S" SQUARE" NAMED
RSAVINS S" TRIANGLE" NAMED
RSAVINS .RING
RSAVINS RCOUNT .
It boots saying HELLO WORLD FROM PDP-7 FORTH in the ring, one element a word. S" AND PIXIE RINGS" SAYS appends, and HELLO starts it again. RINGS starts again with an empty ring at RSAVINS, the front door the panel looks through. When the ring area fills, RSPPIX's own garbage collector takes back what nothing reaches; when nothing can be taken back, Forth says rings full?.
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 does both in the page: it assembles the kernel with its own as7, feeds the Forth sources to the emulated paper tape reader, and keeps the core.
The cabinet's copy keeps names whole, laid out as Open Firmware lays them out. It adds CREATE DOES> with Open Firmware's and CForth's names, and it carries PIXIE's 1972 ring structure processor, RSPPIX, unchanged, with a Forth word for each routine. Open RINGS and type RSAVINS S" SQUARE" NAMED to watch a ring grow. The plans: a PDP-7 and Type 340 assembler written in Forth, Forth and SYMELEC trading drawings through Tiny Titan, and a command line built the Open Firmware way. The full story is in PDP7-FORTH.md and FORTH-RINGS.md.
Source: github.com/MitchBradley/pdp7forth, MIT licence.
packages/cabinet/tapes/pdp7forth/README.md GitHubLoading…