Motherboard Forums


Reply
Thread Tools Display Modes

Embedded Basic Interpreter

 
 
Gary Pace
Guest
Posts: n/a
 
      04-02-2006, 05:29 AM
Howdy Y'all :
I am designing an embedded controller that needs an application programming
ability.
In the base layers of the software I have the basic control blocks running
in compiled C, with setup, referencing and monitoring via registers accessed
via MODBUS links.
What I would like to do is :
1 - Include a BASIC interpreter in my core code. This would be sourced in
generic C and ported to my compiler
2 - Extend the BASIC dialect to have non-standard keywords that I will map
onto API functions in my base code (get and set functions to provide lvalues
and accept assignments). I would somehow throw exceptions at the interpreter
if it made illegal assignments to the control layer
Now I don't want to write a BASIC interpreter myself, so does anybody know
of an interpreter written in C that I can include in my source, point at its
code-to-run (pre-compiled to a byte code offline ideally), point at its
memory for stacks, heaps etc and provide its API's for assigning to/getting
the value of "Controller Variable N"
Thanks
Gary


 
Reply With Quote
 
 
 
 
robertwessel2@yahoo.com
Guest
Posts: n/a
 
      04-02-2006, 07:38 AM

Gary Pace wrote:
> Howdy Y'all :
> I am designing an embedded controller that needs an application programming
> ability.
> In the base layers of the software I have the basic control blocks running
> in compiled C, with setup, referencing and monitoring via registers accessed
> via MODBUS links.
> What I would like to do is :
> 1 - Include a BASIC interpreter in my core code. This would be sourced in
> generic C and ported to my compiler
> 2 - Extend the BASIC dialect to have non-standard keywords that I will map
> onto API functions in my base code (get and set functions to provide lvalues
> and accept assignments). I would somehow throw exceptions at the interpreter
> if it made illegal assignments to the control layer
> Now I don't want to write a BASIC interpreter myself, so does anybody know
> of an interpreter written in C that I can include in my source, point at its
> code-to-run (pre-compiled to a byte code offline ideally), point at its
> memory for stacks, heaps etc and provide its API's for assigning to/getting
> the value of "Controller Variable N"




While not Basic, Tcl may be a good fit. It's OSS and easily extensible.

 
Reply With Quote
 
 
 
 
Leon
Guest
Posts: n/a
 
      04-02-2006, 10:32 AM

Gary Pace wrote:
> Howdy Y'all :
> I am designing an embedded controller that needs an application programming
> ability.
> In the base layers of the software I have the basic control blocks running
> in compiled C, with setup, referencing and monitoring via registers accessed
> via MODBUS links.
> What I would like to do is :
> 1 - Include a BASIC interpreter in my core code. This would be sourced in
> generic C and ported to my compiler
> 2 - Extend the BASIC dialect to have non-standard keywords that I will map
> onto API functions in my base code (get and set functions to provide lvalues
> and accept assignments). I would somehow throw exceptions at the interpreter
> if it made illegal assignments to the control layer
> Now I don't want to write a BASIC interpreter myself, so does anybody know
> of an interpreter written in C that I can include in my source, point at its
> code-to-run (pre-compiled to a byte code offline ideally), point at its
> memory for stacks, heaps etc and provide its API's for assigning to/getting
> the value of "Controller Variable N"
> Thanks
> Gary


Rowley Associates have a BASIC interpreter for the ARM:

http://www.rowley.co.uk

Leon

 
Reply With Quote
 
Jim Stewart
Guest
Posts: n/a
 
      04-02-2006, 06:55 PM
Gary Pace wrote:
> Howdy Y'all :
> I am designing an embedded controller that needs an application programming
> ability.
> In the base layers of the software I have the basic control blocks running
> in compiled C, with setup, referencing and monitoring via registers accessed
> via MODBUS links.
> What I would like to do is :
> 1 - Include a BASIC interpreter in my core code. This would be sourced in
> generic C and ported to my compiler
> 2 - Extend the BASIC dialect to have non-standard keywords that I will map
> onto API functions in my base code (get and set functions to provide lvalues
> and accept assignments). I would somehow throw exceptions at the interpreter
> if it made illegal assignments to the control layer
> Now I don't want to write a BASIC interpreter myself, so does anybody know
> of an interpreter written in C that I can include in my source, point at its
> code-to-run (pre-compiled to a byte code offline ideally), point at its
> memory for stacks, heaps etc and provide its API's for assigning to/getting
> the value of "Controller Variable N"
> Thanks
> Gary


David Dunfield had a little BASIC interpreter
written in C. You might send him an email

http://www.dunfield.com/downloads.htm



 
Reply With Quote
 
larwe
Guest
Posts: n/a
 
      04-02-2006, 07:14 PM

(E-Mail Removed) wrote:

> > 1 - Include a BASIC interpreter in my core code. This would be sourced in

>
> While not Basic, Tcl may be a good fit. It's OSS and easily extensible.


Number of BASIC programmers vs. number of Tcl programmers?

Applicability of saccharine education-substitute (Visual BASIC) to Tcl
vs. a BASIC dialect?

 
Reply With Quote
 
Dave Hansen
Guest
Posts: n/a
 
      04-02-2006, 08:55 PM
On Sun, 02 Apr 2006 05:29:40 GMT in comp.arch.embedded, "Gary Pace"
<(E-Mail Removed)> wrote:

>Howdy Y'all :
>I am designing an embedded controller that needs an application programming
>ability.

[...]
>Now I don't want to write a BASIC interpreter myself, so does anybody know
>of an interpreter written in C that I can include in my source, point at its
>code-to-run (pre-compiled to a byte code offline ideally), point at its
>memory for stacks, heaps etc and provide its API's for assigning to/getting
>the value of "Controller Variable N"


I don't know about BASIC, but you might want to look at Lua. It's
designed to be an embedded scripting language, and has a very easy to
understand syntax and a favorable license. www.lua.org

Regards,
-=Dave

--
Change is inevitable, progress is not.
 
Reply With Quote
 
mhahn@hvc.rr.com
Guest
Posts: n/a
 
      04-02-2006, 10:22 PM
Dave Hansen wrote:
> On Sun, 02 Apr 2006 05:29:40 GMT in comp.arch.embedded, "Gary Pace"
> <(E-Mail Removed)> wrote:
>
> >Howdy Y'all :
> >I am designing an embedded controller that needs an application programming
> >ability.

> [...]
> >Now I don't want to write a BASIC interpreter myself, so does anybody know
> >of an interpreter written in C that I can include in my source, point at its
> >code-to-run (pre-compiled to a byte code offline ideally), point at its
> >memory for stacks, heaps etc and provide its API's for assigning to/getting
> >the value of "Controller Variable N"

>
> I don't know about BASIC, but you might want to look at Lua. It's
> designed to be an embedded scripting language, and has a very easy to
> understand syntax and a favorable license. www.lua.org
>
> Regards,
> -=Dave
>
> --
> Change is inevitable, progress is not.


There's always tiny basic (I'm a bit amazed that I can still remember
buying the issue of Dr Dobbs it was published in).

There was a recent article in Dr Dobbs (Jan 2006?) by the guy who wrote
the original, he has his own web site at:
http://www.ittybittycomputers.com/IttyBitty/TinyBasic/

and here's another version written in C:
http://www.ddj.com/documents/s=10032...01b/0601b.html

It looks like less than 1000 lines of code. How hard could it be to get
working :-)

Not sure what the copyright arrangements are for either of these, and I
have never used either. But they look interesting.

Post something back to the group if these ore something else you find
works for you.

Mark

 
Reply With Quote
 
Leon
Guest
Posts: n/a
 
      04-02-2006, 11:17 PM

(E-Mail Removed) wrote:
> Dave Hansen wrote:
> > On Sun, 02 Apr 2006 05:29:40 GMT in comp.arch.embedded, "Gary Pace"
> > <(E-Mail Removed)> wrote:
> >
> > >Howdy Y'all :
> > >I am designing an embedded controller that needs an application programming
> > >ability.

> > [...]
> > >Now I don't want to write a BASIC interpreter myself, so does anybody know
> > >of an interpreter written in C that I can include in my source, point at its
> > >code-to-run (pre-compiled to a byte code offline ideally), point at its
> > >memory for stacks, heaps etc and provide its API's for assigning to/getting
> > >the value of "Controller Variable N"

> >
> > I don't know about BASIC, but you might want to look at Lua. It's
> > designed to be an embedded scripting language, and has a very easy to
> > understand syntax and a favorable license. www.lua.org
> >

L > Regards,
> > -=Dave
> >
> > --
> > Change is inevitable, progress is not.

>
> There's always tiny basic (I'm a bit amazed that I can still remember
> buying the issue of Dr Dobbs it was published in).
>
> There was a recent article in Dr Dobbs (Jan 2006?) by the guy who wrote
> the original, he has his own web site at:
> http://www.ittybittycomputers.com/IttyBitty/TinyBasic/
>
> and here's another version written in C:
> http://www.ddj.com/documents/s=10032...01b/0601b.html
>
> It looks like less than 1000 lines of code. How hard could it be to get
> working :-)
>
> Not sure what the copyright arrangements are for either of these, and I
> have never used either. But they look interesting.
>
> Post something back to the group if these ore something else you find
> works for you.
>
> Mark


I just downloaded the C version and compiled it with gcc. It works OK.

I remember that issue of DDJ, as well. A friend of mine keyed Wang's
Tiny BASIC into his S100 system (in hex) and got it working. It was
later used on the original 4k TRS-80 Level 1 Model I. The 16k Level 2
version used Microsoft BASIC.

Leon

 
Reply With Quote
 
Jim Stewart
Guest
Posts: n/a
 
      04-02-2006, 11:37 PM
Leon wrote:
> (E-Mail Removed) wrote:
>
>>Dave Hansen wrote:
>>
>>>On Sun, 02 Apr 2006 05:29:40 GMT in comp.arch.embedded, "Gary Pace"
>>><(E-Mail Removed)> wrote:
>>>
>>>
>>>>Howdy Y'all :
>>>>I am designing an embedded controller that needs an application programming
>>>>ability.
>>>
>>>[...]
>>>
>>>>Now I don't want to write a BASIC interpreter myself, so does anybody know
>>>>of an interpreter written in C that I can include in my source, point at its
>>>>code-to-run (pre-compiled to a byte code offline ideally), point at its
>>>>memory for stacks, heaps etc and provide its API's for assigning to/getting
>>>>the value of "Controller Variable N"
>>>
>>>I don't know about BASIC, but you might want to look at Lua. It's
>>>designed to be an embedded scripting language, and has a very easy to
>>>understand syntax and a favorable license. www.lua.org
>>>

>
> L > Regards,
>
>>> -=Dave
>>>
>>>--
>>>Change is inevitable, progress is not.

>>
>>There's always tiny basic (I'm a bit amazed that I can still remember
>>buying the issue of Dr Dobbs it was published in).
>>
>>There was a recent article in Dr Dobbs (Jan 2006?) by the guy who wrote
>>the original, he has his own web site at:
>>http://www.ittybittycomputers.com/IttyBitty/TinyBasic/
>>
>>and here's another version written in C:
>>http://www.ddj.com/documents/s=10032...01b/0601b.html
>>
>>It looks like less than 1000 lines of code. How hard could it be to get
>>working :-)
>>
>>Not sure what the copyright arrangements are for either of these, and I
>>have never used either. But they look interesting.
>>
>>Post something back to the group if these ore something else you find
>>works for you.
>>
>>Mark

>
>
> I just downloaded the C version and compiled it with gcc. It works OK.
>
> I remember that issue of DDJ, as well. A friend of mine keyed Wang's
> Tiny BASIC into his S100 system (in hex) and got it working. It was
> later used on the original 4k TRS-80 Level 1 Model I. The 16k Level 2
> version used Microsoft BASIC.


I can go you one better. I wrote and
integrated save and load functions into
it for a Phi-deck digital cassette deck.







 
Reply With Quote
 
msg
Guest
Posts: n/a
 
      04-03-2006, 01:57 AM
Jim Stewart wrote:

> I can go you one better. I wrote and
> integrated save and load functions into
> it for a Phi-deck digital cassette deck.
>


I bought the Phi-deck dual drive eval kit at Wescon
when it came out (still packed away until I can
get at it). Do you have your code and interface
schematic?

Regards,

Michael Grigoni
Cybertheque Museum
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Embedded Basic interpreter recommendations? Jon Kirwan Embedded 49 03-16-2009 10:44 PM
Re: Embedded Basic interpreter recommendations? Anton Erasmus Embedded 2 03-10-2009 12:00 AM
Re: Embedded Basic interpreter recommendations? zwsdotcom@gmail.com Embedded 3 03-09-2009 11:37 PM
Re: Embedded Basic interpreter recommendations? -jg Embedded 0 03-09-2009 09:35 PM
Re: Embedded Basic interpreter recommendations? M.O.B. i L. Embedded 1 03-09-2009 08:38 PM


All times are GMT. The time now is 09:18 AM.


Welcome!
Welcome to Motherboard Point
 

Advertisment