Also, for a small demo, check Eforth under Subleq/Muxleq:
https://github.com/howerj/subleq
edit subleq.fth/muxleq.fth and set these options to 1:
1 constant opt.multi ( Add in large "pause" primitive )
1 constant opt.editor ( Add in Text Editor )
1 constant opt.info ( Add info printing function )
0 constant opt.generate-c ( Generate C code )
1 constant opt.better-see ( Replace 'see' with better version )
1 constant opt.control ( Add in more control structures )
0 constant opt.allocate ( Add in "allocate"/"free" )
1 constant opt.float ( Add in floating point code )
0 constant opt.glossary ( Add in "glossary" word )
1 constant opt.optimize ( Enable extra optimization )
1 constant opt.divmod ( Use "opDivMod" primitive )
0 constant opt.self ( self-interpreter [NOT WORKING] )
Then run this to create a new EForth image with float/do...loop and such: ./muxleq ./muxleq.dec < muxleq.fth > new.dec
Subleq is the original one, muxleq it's multiplexed. The command it's the same, just replace
muxleq with subleq (edit the fth file too).Usage: ./muxleq new.dec
For a brief help:
words
On Forth syntax, the EForth Overview PDF will be enough, except for 8086 related code, where here it's different.It's impressive what you can do in the C64 with just Forth instead of C64 Basic.
For Speccy/ZX80/ZX81, I'm pretty sure they ported the Jupyter ACE one, boosting up the available RAM in the 48k and 128k making Basic almost obsolete in that platform.
It's not large.
The ZEROEQUALS function can be replaced by: pop ax; neg ax;sbb ax,ax;push ax
That said interpreting the brainfuck mandelbrot program takes several hours. On an old CP/M system I have a brainfuck compiler that converts a program to Z80 machine code, and that same mandelbrot example runs in less than two seconds.
So speed isn't great, but having brainfuck really proves a toy system is "real".