Skip to content

Repository files navigation

sw-cor24-forth — Tiny Forth for COR24

Clean-room DTC (Direct Threaded Code) Forth for the COR24 24-bit RISC soft-CPU ISA. Assembler kernel (forth.s), self-extending in Forth.

Part of the COR24 ecosystem.

Provenance

Forked from sw-vibe-coding/tf24a as part of the COR24 ecosystem consolidation under the sw-embed organization.

Prerequisites

Quick Start

# Run demo
./demo.sh

# Interactive REPL
./demo.sh repl

# Run test suite
./demo.sh test

# Or via build script
scripts/build.sh

Architecture

  • forth.s — 2600+ line COR24 assembly implementing a complete DTC Forth
  • Register allocation: r0=W, r1=RSP, r2=IP, sp=DSP
  • Cell size: 3 bytes (24-bit words)
  • I/O: UART at address -65280 (0xFF0100)

Built-in Words

+ - * AND OR XOR = < 0= DUP DROP SWAP OVER >R R> R@ @ ! C@ C! EMIT KEY EXIT HERE LATEST STATE BASE , C, ALLOT WORD FIND CREATE : ; IMMEDIATE [ ] EXECUTE NUMBER . LED! INTERPRET QUIT CR SPACE HEX DECIMAL DEPTH .S WORDS BYE

Examples

See examples/ for .fth source files demonstrating colon definitions, LED control, math, and more.

Related Repositories

Links

Copyright

Copyright (c) 2026 Michael A. Wright

License

MIT License. See LICENSE for the full text.

About

Tiny Forth for the COR24 24-bit RISC soft-CPU — DTC assembler kernel

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages