The author, writing on Leaded Solder, explains their motivation for the project: seeking a self-hosted programming environment for their Sega SG-1000 clone that wouldn't rely on external computers for development. After finding Sega's built-in BASIC limiting, they chose Forth for its minimalism, suitability for embedded systems, and ability to include an integrated assembler allowing native code development directly on the hardware. The porting process began with CamelForth-80, a GPL-licensed Forth implementation originally targeting CP/M-80 systems. Following the project's porting guide, the author needed to adapt the code for bare-metal SG-1000 operation by handling hardware initialization, stack setup, and replacing three CP/M-dependent words (KEY, KEY?, EMIT). Significant challenges arose during assembly due to differences between the original Z80MR assembler and the author's preferred Zasm tool. Zasm's stricter single-pass evaluation requirements caused macro expansion issues with CamelForth's header macro, particularly around conditional assembly. The author resolved this by creating separate macro variants for docode and non-docode cases. Additional complications included Zasm's difficulty parsing Forth's unconventional word names containing special characters like quotes and commas, which required revising macro invocations to use proper string quoting. Case-sensitive label handling was addressed using Zasm's --casefold option to mimic traditional CP/M assemblers. For hardware interaction, the author implemented the EMIT function to output characters via the TMS9918 Video Display Processor in Graphics 1 mode (32x24 tile display), acknowledging limitations like lack of hardware scrolling but noting suitability for television display. The project is being undertaken as part of RetroChallenge 2026/10, a monthly informal retrocomputing competition that helps focus development efforts. The author emphasizes their limited Forth expertise, framing the project as a demonstration of how accessible Forth porting can be rather than claiming mastery of the language. Current work focuses on getting the interpreter running on the Soggy-1000 hardware, with foundational components like the EXIT word already successfully assembled.
HN Digest / · HN #49924121
Hacker News user ports Forth to Sega SG-1000 clone for RetroChallenge
A retrocomputing enthusiast has successfully ported the CamelForth-80 interpreter to their SG-1000 hardware clone (dubbed 'Soggy-1000'), overcoming assembler compatibility issues and hardware-specific implementation challenges to create a functional Forth development environment for the 1980s Sega console.

Screenshot of the source page (leadedsolder.com)