Most of the changes in v2.2.3 are non-functional, but some is nevertheless important:
- I/O code in board folders: This change concentrates most of the board dependent code, i.e. initialization, interrupts, RX!, ?TX and OUT!, into the configuration folders. There is some risk of some future code repetition for very similar boards but this can be addressed as it arises. Future work will add more abstraction code (like BKEYCHAR for keyboard translation).
- improved vocabulary options The vocabulary options were reviewed and aligned with certain use cases: "Forth as a Scripting Language", "Self-hosted µC Development", and "Forth Interpreter Lab". Most users won't have the third use case, but if they need it the words the interpreter consists of can be linked.
- fix off-by-one in DEPTH and rp!: In both DEPTH and rp! were bugs that canceled each other out, but that left the number 0x3FF (1023) on the floor of the stack. This became visible when rp! was re-implemented in in-line assembly to save space.
- binary size reduction: Due to re-write of many routines in assembly, frequent use of short addressing modes, more factoring, and several optimized eForth core words the size of CORE including "Compile to Flash memory" is now below 4KiB (3800 bytes without this option). Further improvements would require abandoning STC in favor of DTC or even ITC.
- Retab: Unfortunately different authors left a mix of different tab width in the code. There was a retab-only commit to facilitate comparing code changes.
Did I mention that MINDEV is still below 5000 bytes even if I linked or added 22 words more to the vocabulary than in the last release?
stm8eForth v2.2
words
RESET RAM NVM LOCKF ULOCKF LOCK ULOCK ADC@ ADC! 2C@ 2C!
BITSR WORDS .S DUMP VARIABLE DOES> CREATE IMMEDIATE :
CALL, ] ; ." $" ABORT" AFT REPEAT WHILE AHEAD ELSE THEN
IF AGAIN UNTIL BEGIN +LOOP LOOP DO NEXT FOR $," LITERAL
COMPILE [COMPILE] C, , ALLOT ' [ \ ( .( ? . U. TYPE U.R
.R CR SPACES SPACE NUF? KEY DECIMAL HEX str #> SIGN #S
# HOLD <# DIGIT PACK$ ERASE FILL CMOVE @EXECUTE PAD
HERE COUNT 2@ 2! +! DEPTH PICK 0= ABS NEGATE NOT 2/ 1-
1+ 2* 2- 2+ */ */MOD M* * UM* / MOD /MOD M/MOD UM/MOD
WITHIN MIN MAX < U< = DNEGATE 2DUP ROT ?DUP FILE HAND BG
TIM -1 1 0 BL OUT '?KEY 'EMIT hld BASE UM+ - 0< OR AND
XOR + OVER SWAP DUP >R R@ 2DROP DROP I R> C! C@ ! @ EXIT
EXECUTE LEAVE EMIT ?KEY hi 'BOOT OUT! TX! ?RX COLD ok
Now I did :-)As usual, the binary release is on GitHub.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.