FiveForths is a tiny Forth written in hand-coded RISC-V assembly, initially designed to run on the 32-bit Longan Nano (GD32VF103) microcontroller.
FiveForths currently uses the indirect threading model and only has 19 built-in primitive words. It is 100% fully functional and can be extended by adding new primitives (in Assembly) or by defining new words (in Forth). This implementation is loosely inspired by sectorforth, jonesforth, and derzforth.
Development progress has been logged regularly in the devlogs.
The quickest way to get started is to download and flash one of the firmware binaries listed below:.
- fiveforths-longan-nano-lite.bin (64K Flash, 20K RAM)
- fiveforths-longan-nano.bin (128K Flash, 32K RAM)
See the TUTORIALS for detailed download and flashing information.
- TUTORIALS: a quick guide to get started
- EXPLAIN: learn the story behind FiveForths
- HOWTO: build, usage, and code examples in Forth and RISC-V Assembly
- REFERENCE: learn the technical details, what's under the hood
- Code cleanup and optimizations
Please create a pull-request or open an issue on GitHub.
- Fix issue #19 - Error building without zicsr extension
- Fix issue #20 - Specify
stm32loader
instead ofdfu-util
in docs
- Fix issue #16 - Add the ability to read hex numbers
- Update documentation
- Add example for toggling an LED
- Fix issue #7 - Implement bounds checks for stacks
- Fix issue #8 - Implement bounds checks for user dictionary
- Fix issue #13 -
TOIN
should not be an address - Fix issue #14 -
STORE
primitive is incorrect - Add better error messages
- Add detailed documentation in docs
- Add
djb2.c
to generate a word's hash locally - Add RAM zerofill of unused dictionary space on reset
- Fix issue #9 - Handling of carriage return
- Fix issue #11 - Ignore non-printable characters
- Re-organize code to support different boards and MCUs
- Add boot message when the device is reset
- Add GitHub action to automatically build and publish the firmware binaries
Copyright (c) 2021~ Alexander Williams