Close

More Good Testing, Bugs Fixed, uCsim

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

thomasThomas 06/15/2017 at 16:090 Comments

@RigTig found a very nasty bug that only bites advanced Forthers: the STM8EF compiler uses CALLR (2 bytes) instead of CALL (3 bytes) when called words are within reach of relative addressing. However, the COMPILE instruction, that's normally used in "immediately executed code" (the kind of code in which the Forth compiler is written), assumes that a 3 bytes (absolute) CALL is used. It took a while until I understood what's the issue. Thanks for the patience!

The bug is now fixed, and the additional code was compensated by optimizations (the binary size is still the same).

When I fixed the bug I used uCsim by Dániel Drótos. The latest development version of uCsim has UART support and the MINDEV, CORE, or STM8S105K4 binaries work out of the box (this also means you don't need hardware for testing STM8EF).

Discussions