Close

STM8 eForth 2.2.19: New features tested in W1209 project

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

thomasThomas 10/30/2017 at 16:130 Comments

Folder "target" used for board specific output

@RigTig came up with use cases for a tiny Forth that required some innovation. This led to the development of the ALIAS feature, which can be used as a secondary (or temporary) dictionary entry. Long story short: from STM8 eForth 2.2.19 on aliases for unlinked Forth words are automatically generated into the folder out/<BOARD>/target during the build process.

When writing applications, all that's needed is a symlink to the desired target folder.

There are more goodies:

Auto-generated file FORTH.efr for STM8 eForth core RAM locations

The RAM addresses of internal core variables like 'PROMPT are now exported automatically to the file out/<BOARD>/FORTH.efr.

FORTH.efr contains lines like the following:

0068 equ 'PROMPT \  "'PROMPT" point to prompt word (default .OK)

In e4thcom compatible code this data can be used with the `\res` meta-statement:

\res MCU: FORTH
\res export 'PROMPT

It is now a recommended for STM8 eForth projects that use a binary release to set a symlink in the base folder to out/<BOARD>/FORTH.efr.

Emulation of e4thcom \res improved

The emulation of \res in codeload.py now tests if a word already exists in the dictionary before defining a CONSTANT. The behavior is now as robust as that of #require.

By the way, using a Forth CONSTANT doesn't necessarily require any additional memory: STM8 eForth allows defining CONSTANT words in RAM, and using them for building words in the Flash memory. They create a normal LITERAL during compilation, and can be discarded afterwards.

Tools folder part of the binary release

The tools folder is now part of the binary release file. An STM8 eForth project that uses the binary release can simply use tools (e.g. codeload.py) from the upstream project.

And finally:

Eating my own Dogfood

TG9541/W1209 contains an example implementation with dependency resolution. I'll be concentrating on finishing that project, and learning about required features for STM8 eForth on the way.

Discussions