Page 1 of 1
STM32 BASIC Language Interpreter
Posted: Thu Dec 27, 2012 3:08 pm
by 8bitgeek
I am pleased to say that I have developed a BASIC language interpreter and command line, that's currently running nicely stand-alone on STM32F103R.
http://8bit.zapto.org/DaddyBASIC.htmlIt's written in C++, should be an easy port to get it ported to Chibios, I think that wil be the next step.
Version 1.1 interprets ASCII text. Version 1.2 compiles ASCII text into byte codes, and will execute either compiled or uncompiled (or mixed) program text. The compiler still needs some optimization, for insatnce numbers are still represented in ASCII form.
The function library is currently not terribly rich, and has some basic functions for accessing GPIO pins.
Although it seems to be running quite well, it is still very 'Alpha' with a total of < 4 hours run time on it!
Re: STM32 BASIC Language Interpreter
Posted: Thu Dec 27, 2012 3:20 pm
by Giovanni
Hi,
Great job, it would be nice making it wrap some HAL functionalities for I/O. Making it run within a thread should not be a problem.
Giovanni
Re: STM32 BASIC Language Interpreter
Posted: Thu Dec 27, 2012 3:42 pm
by 8bitgeek
Giovanni wrote:Hi,
Great job, it would be nice making it wrap some HAL functionalities for I/O. Making it run within a thread should not be a problem.
Giovanni
Indeed, that's what I'm thinking, I'll run the BASIC interpreter in a thread, such that there can be more than one instance running, and I'll wrap some of the HAL functionality in function calls.
Will implement something like an interrupt/event handler as well :
100 ON <some event trigger> GOSUB 1000
150 let busy_work = busy_work + 1
200 goto 150
1000 print "got event"
1010 return
Something like that...
--Mike
Re: STM32 BASIC Language Interpreter
Posted: Thu Dec 27, 2012 8:20 pm
by Tectu
Well done and thanks for sharing!

~ Tectu
Re: STM32 BASIC Language Interpreter
Posted: Fri Dec 28, 2012 3:51 pm
by 8bitgeek
Tectu wrote:Well done and thanks for sharing!

~ Tectu
I just posted an update at
http://8bit.zapto.org/Download%20DaddyBASICMostly a number of bug fixes, some execution time improvements, and a couple usability refinements.
I think the heap is the main execution bottle neck now (I'm using a bitmap heap, it's nice for debugging memory allocation issues, but a little sluggish), I have a super fast heap I'll try at somepoint, but I think I'll work on the ChibiOS migration first while I have a pretty stable version to start with.
--Mike
Re: STM32 BASIC Language Interpreter
Posted: Thu Feb 28, 2013 4:19 pm
by Pablo2048
8bitgeek wrote:I just posted an update at
http://8bit.zapto.org/Download%20DaddyBASICMostly a number of bug fixes, some execution time improvements, and a couple usability refinements.
I think the heap is the main execution bottle neck now (I'm using a bitmap heap, it's nice for debugging memory allocation issues, but a little sluggish), I have a super fast heap I'll try at somepoint, but I think I'll work on the ChibiOS migration first while I have a pretty stable version to start with.
--Mike
It seems like there is something wrong with Your pages...
Sincerely
Pablo2048