How to make a bootloader:
7000 value buf
: go s" boot" buf loadb
buf ae @ buf - evaluate ;...
' go start !
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!
DurexForth is now available as a cartridge image!
Improved vi saving, added require/required, documented assembler + SID
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...)
https://github.com/jkotlinski/durexforth/releases/tag/v1.5.0 for downloads and full change log.
Thanks to polluks for suggestions!
* 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!
* 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!
* 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!
* 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