Close

STM8 eForth: Bugfix for PICK

A project log for eForth for cheap STM8S gadgets

Turn cheap modules from AliExpress into interactive development kits!

thomasThomas 02/09/2018 at 17:100 Comments

M. Mahlow reported what appears to be an old STM8 eForth bug:

    1 PICK equals DUP

The correct behavior is:

    0 PICK equals DUP
    1 PICK equals OVER

Note: the correction is a braking change!

Fact is that in STM8 eForth PICK never worked as it should. The core uses PICK only once (in .S), and there 1+ was applied just before calling PICK (with a different indentation). Of course, PICK could have been fixed instead of "fixing" a routine using it.

In STM8 eForth 3 library functions had to be fixed ( @inter, 2OVER, and DSQRT). Hopefully not too much user code depends on the buggy PICK behavior.

Discussions