How to make a bootloader:

7000 value buf
: go s" boot" buf loadb
buf ae @ buf - evaluate ;...
' go start !
save-forth @0:durexforth

This will save a new Forth that at startup loads and interprets the code in "boot". Very practical for editing code on PC and testing quickly in emulator!

See More

v1.6.2 out now, a collection of minor improvements.

durexforth - Modern C64 Forth


Let's start right off with a controversial claim: Forth is the hacker's programming language. Coding in Forth is a little bit like writing assembly language, interactively, for a strange CPU architect...

Tested the cartridge version a bit on one of my machines and Ultimate-1541. Seems vi doesn't work that well with Swedish Kernal. Don't think I care much about Swedish anyway, Forth is kind of useless without [], so went eBay shopping for some international chips...

bugfixes and small improvements. for example, open files with 'vi file' instead of 's" file" vi'

Thinking about whether to optimize branches like if/else/then, begin/repeat/until/while. It would be a lot faster if those could be short branches (beq) instead of jmp. The drawback then is that the code to determine whether to write short or long branch by itself takes some RAM. Disallowing long branches could also be possible, and would force better factoring, but then perfectly valid code must be rejected. Dilemmas!!

It was a lot of work, but DurexForth now passes the entire Forth 2012 core test suite! (With some tweaks for ASCII/PETSCII mismatches...) for downloads and full change log.

Thanks to polluks for suggestions!

No automatic alt text available.

2015-12-30: v1.4.6

* bugfix: disabled tail call elimination for literal ['] [char]
to avoid some crashes
* bugfix: <, rshift, u. did not support negative numbers
* forth: made word finding + numbers case insensitive
* forth: renamed char to getc, and added a new char that works
according to the Forth 2012 standard....
* forth: added abort, abort", 2@, 2!, char+, chars, align, aligned
* forth: key, key? now work only with keyboard
* forth: made quit reset input and fall back to keyboard
* forth: fill ( ch addr len ) changed to fill ( addr len ch )
* forth: allot ( -- n ) changed to allot ( -- )
* forth: made base a variable instead of a value
* forth: changed variable; data field is now after code field

Thanks to Christian Johansson for suggestions!

See More

* forth: / now uses floored signed division
* forth: bugfix for negative number parsing (2- was interpreted as -20)
* forth: made 2/ sign-extend negative numbers
* forth: added spaces source >in 2over 2swap m+ m* sm/rem fm/mod dabs dnegate s>d
* forth: changed word order of double-cell integers
* vi: backspace on start of line now doesn't join lines
* doc: mention in tutorial that default is hexadecimal


Thanks to Christian Johansson and polluks for suggestions!

See More

* forth: added u. unloop leave cell+ cells page key?
* forth: allow input of negative numbers
* forth: optimized cmove, cmove>
* forth: made . print signed numbers
* forth: various bugfixes
* doc: simplified & improved intro + tutorial...
* vi: bugfix, exiting editor disabled key repeat

Thanks to Christian Johansson and polluks for bug reports!

See More

* forth: made +loop work like it should
* forth: removed <=, >=
* forth: renamed <, > to u<, u>
* forth: renamed s<, s> to <, >
* forth: renamed d* to um*
* forth: optimized loop, r>, >r, r@, i
* forth: disabled tail call elimination for (
* vi: faster key delay+repeat...
* vi: hid fg
* vi: various bugfixes
* doc: documented min, max, within

See More