STM8S103F3 Development Board (HCDVBD0034)

ST Microelectronics microcontroller development boards and accessories
Alfredo
Posts: 23
Joined: Sat May 13, 2017 12:43 pm

Re: STM8S103F3 Development Board (HCDVBD0034)

Post by Alfredo » Wed Oct 25, 2017 5:31 pm

There is a new updated version STM8eForth 2.2.18, and if you build from the most recent source the version counter shows 2.2.19!

The most interesting part is clearly the export of register address words from resource files with "\res export". The feature depends on e4thcom but there is also platform independent code (codeload.py).

Edit: ouch, double post! Let's turn it into a new post!
Last edited by Alfredo on Thu Nov 02, 2017 5:58 am, edited 2 times in total.

barewires
Posts: 49
Joined: Wed Aug 21, 2013 7:38 am

Re: STM8S103F3 Development Board (HCDVBD0034)

Post by barewires » Thu Oct 26, 2017 2:55 pm

@alfredo You may want to remove the duplicate posts as it appears to be shouting.

One problem I see is that you are using a word to represent a constant, 10 bytes used for a two byte value, very bad code. Just because you can do something in eForth, doesn't mean that you should. Learners should not be taught this. As an expert you should already know that.

This is like calling a function or routine to return a single value. There are eForth structures to handle this. In the Microchip PIC the instruction RETLW does just that, returns a literal as used in lookup table calls, only because it has 35 instructions and limited power. Perhaps you are an expert in that chip too?

Instead of lurking perhaps you should post some OC original content. Teach people things that I haven't.

Alfredo
Posts: 23
Joined: Sat May 13, 2017 12:43 pm

Re: STM8S103F3 Development Board (HCDVBD0034)

Post by Alfredo » Thu Nov 02, 2017 6:24 am

Bad style? It depends :-)

A CONSTANT can be in RAM, and only exist as long as you need it to write the "hardware dependent code". The runtime part of constant detects the state (compiler or interpreter), and returns either the value or compiles a literal (3 bytes).

The source code of CONSTANT is here. The code is now in the kernel, and it looks much more compact than in the Forth source.

The source code uses MARKER which is also a nice example of advanced Forth programming.

Both examples use "headerless" code: as long as you only need the address of the code (e.g. stored in a temporary ALIAS) a Forth word (a factor) consumes very little code space.

Post Reply

Return to “ST Microelectronics”