cancel
Showing results for 
Search instead for 
Did you mean: 

FORTH for STM8S-Discovery

ting
Associate II
Posted on July 20, 2010 at 07:08

Here is a FORTH interpreter-compiler for Discovery Board.  It is in the form of an assembly file stm8ef.asm.  You can assemble it on STVD and download it to Discovery.  You need a UART connection to Hyperterminal on PC to interact with STM8S microcontroller.

If you are lucky enough, or persist enough to get it going, the whole Hyperterminal project will be reduced to 6 lines of FORTH code:

 1 500F C! ; turn off LED

 0 500F C! ; turn on LED

 3E 50F3 C! ; turn on 1 KHz beep

 7E 50F3 C! ; turn on 2 KHz beep

 FE 50F3 C! ; turn on 4 KHz beep

 1E 50F3 C! ; turn off beep

This is how microcontrollers are to be used.

Good luck,

Ting. 
14 REPLIES 14
holinepu
Associate II
Posted on January 04, 2011 at 09:00

What do you think of this kind of assembler? ( HLAA )

Does it appeal to you?

It's also universal for other cpus include ARM, 8051....

                               8:  init.stm8s

  (  0357  AE 07 CF       )                                 X=7CF

  (  035A  94             )                                 SP=X

  (  035B  BF 24          )                                 r24=X

  (  035D  AE 07 80       )                                 X=780

  (  0360  BF 22          )                                 r22=X

  (  0362  35 01 50 11    )                                 r5011=1

  (  0366  35 03 50 12    )                                 r5012=3

  (  036A  35 01 50 13    )                                 r5013=1

  (  036E  72 12 50 C5    )                                 r50C5.1=1

  (  0372  35 B4 50 C4    )                                 r50C4=0B4

  (  0376  72 07 50 C5 FB )                 0376            r50C5.3=0?

  (  037B  72 17 50 C5    )                                 r50C5.3=0

  (  037F  35 02 52 43    )                                 r5243=2

  (  0383  35 68 52 42    )                                 r5242=68

  (  0387  35 00 52 44    )                                 r5244=0

  (  038B  35 00 52 46    )                                 r5246=0

  (  038F  35 0C 52 45    )                                 r5245=0C

  (  0393  81             )                                 RET

holinepu
Associate II
Posted on January 18, 2011 at 02:40

A win32for4.2.671 based stm8s eForth development system can be found on the web site. The development process is simple, just type  H to see the operation.

This system is capable of develop the stm8s eForth as well as 8bit/16bit tinyForth that accompanying with stm8s eForth. Besides that, you don't have to design it in forth language, it can be treated as an assembler that can develop the program in an easy read/write style which is completely diferrent from the traditional ones. The same approach can also be used in diferrent cpus such as 8051, ARM, ... It's a revolutionary reformation of the assembly language you've ever seen, and it's universal. 

you could find it on the web site below with the folder name: stm8s discovery.

the main file is stm8s69d.f.  Just load it, and type H, then words' to see the whole things behind.

infoinfo967
Associate II
Posted on January 21, 2011 at 20:09

Hi Chang.jyijinn,

I cant not find this file, I did the login in yahoogroups, and I dont find the file or not understand exactly how to obtain.

are there other option to obtain information about Forth, I always program with asm and I'm interested.

Thanks

holinepu
Associate II
Posted on February 01, 2011 at 02:54

hi, there.

    It's easy to find the folder name to get the main file. From which you could find the including file needed to couple with main file to work with.

    Firstly by reading  the ...lst.f  to see what all the things inside the memory to appeal to you if you'd like you'll be willing to indulge into this interseting assembly language as well as tinyFoth.                 holi

Posted on December 31, 2017 at 18:21

 aouinet.slim wrote:

Nice job, I need to save my new words in flash now

Just for the records: that bit was solved about 6 years later.

Check out https://github.com/TG9541/stm8ef