Motherboard Forums


Reply
Thread Tools Display Modes

Embedded Basic Interpreter

 
 
Jim Stewart
Guest
Posts: n/a
 
      04-03-2006, 02:53 AM
msg wrote:

> 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?


Long gone, sadly. I was one of 3 working
at a tiny startup in Oakland Cal. We were
all IMSAI vets. One guy did the analog,
another did the digital interface and a
third that wasn't present did the OS. It
ran a very early spinoff of CP/M with a
block oriented structure like Dectape.

It worked pretty good, but we couldn't
compete with Northstar's cheap floppy.
 
Reply With Quote
 
 
 
 
msg
Guest
Posts: n/a
 
      04-03-2006, 03:08 AM
Leon wrote:

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


I compiled it with __STDC__ on AT&T SVR4 and it works well.

Regards,

Michael Grigoni
Cybertheque Museum
 
Reply With Quote
 
 
 
 
robertwessel2@yahoo.com
Guest
Posts: n/a
 
      04-03-2006, 07:23 AM

larwe wrote:
> (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?



Don't know, but VB certainly won't teach anyone anything very useful
related to what you're likely to find in an embedded Basic scripting
language.

 
Reply With Quote
 
Peter Dickerson
Guest
Posts: n/a
 
      04-03-2006, 02:21 PM
"Dave Hansen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


I too am looking for a scripting option. I had a look at Lua. No problems
porting it to my system, except one of my own making. The code added about
100K, which is OK for me, but RAM is tight and Lua used about 25K of RAM
just to start up (priune the libs could reduce that) - that was just too
much in my case.

Peter


 
Reply With Quote
 
KenLem
Guest
Posts: n/a
 
      04-05-2006, 04:24 PM
I'm in the middle of writing a Basic byte code compiler for the Cypress
PSoC's. The VM is currently in C but I will port it to ASM once I have
it feature complete.

It's an interesting task.

 
Reply With Quote
 
Norm Dresner
Guest
Posts: n/a
 
      04-06-2006, 01:15 PM
"KenLem" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
| I'm in the middle of writing a Basic byte code compiler for the Cypress
| PSoC's. The VM is currently in C but I will port it to ASM once I have
| it feature complete.
|
| It's an interesting task.

If you leave it in C, it will be easier to port to other CPUs. And could
become a viable product in its own right.

Norm

 
Reply With Quote
 
KenLem
Guest
Posts: n/a
 
      04-06-2006, 01:31 PM
I hope to always maintain the master version of the VM in C for just
those reasons. I need to port it to ASM for the PSoC because it takes
up around 5k in C but I suspect it would be < 2k in ASM. I'm working
with the the PRoC which has a built in radio and I don't have much room
left over for the VM.

Also, the select statement in the C compiler I'm using generates a
giant if then else when it parses the bytecodes. I'm using a jump
table in ASM that should really speed up the VM. Of course, my main
concern with the VM isn't speed. I just a little multi-purpose device
with a radio on it.

> If you leave it in C, it will be easier to port to other CPUs. And could
> become a viable product in its own right.
>
> Norm


 
Reply With Quote
 
Hans-Bernhard Broeker
Guest
Posts: n/a
 
      04-06-2006, 08:14 PM
KenLem <(E-Mail Removed)> wrote:

> Also, the select statement in the C compiler I'm using generates a
> giant if then else when it parses the bytecodes.


<nitpick>No, it doesn't: C has no select statement</nitpick>.

And you cannot use a better C compiler?

> I'm using a jump table in ASM that should really speed up the VM.


If you think you need ASM just to implement a jump table in C, then
maybe you need to re-think your plan, and learn how to utilize the
language you have well before you venture into making your own one.
Jump tables are trivially implementable as arrays of functions
pointers, in C.

--
Hans-Bernhard Broeker ((E-Mail Removed)-aachen.de)
Even if all the snow were burnt, ashes would remain.
 
Reply With Quote
 
KenLem
Guest
Posts: n/a
 
      04-06-2006, 09:22 PM
Hans,

OK, no select but switch statement. I apologize for my error.

I know I can implement a jump table in C but thanks for your reply.
The switch to ASM has more to do with code space than speed.

As far as I know, there is only one C compiler for the PSoC. I'm not
complaining about its code generation size. It's pretty good however
it is still a C compiler. The target device has 8k flash and the VM
is now around 5k. I need the VM to fit in around 2k to allow room for
other function such as the radio. I could code the jump table in C but
I don' t think I'll see the type of size reduction I can expect by
writing the entire VM by hand in ASM. It might be worth the effort to
find out just what the size reduction would be.

 
Reply With Quote
 
Anton Erasmus
Guest
Posts: n/a
 
      04-07-2006, 02:16 PM
On 6 Apr 2006 20:14:10 GMT, Hans-Bernhard Broeker
<(E-Mail Removed)-aachen.de> wrote:

>KenLem <(E-Mail Removed)> wrote:
>
>> Also, the select statement in the C compiler I'm using generates a
>> giant if then else when it parses the bytecodes.

>
><nitpick>No, it doesn't: C has no select statement</nitpick>.
>
>And you cannot use a better C compiler?
>
>> I'm using a jump table in ASM that should really speed up the VM.

>
>If you think you need ASM just to implement a jump table in C, then
>maybe you need to re-think your plan, and learn how to utilize the
>language you have well before you venture into making your own one.
>Jump tables are trivially implementable as arrays of functions
>pointers, in C.


Strictly speaking it would be a call table. GCC supports a computed
goto, where one can have an array of goto labels. This generates a
true jump table. I am not aware of other C compilers that
support this extention.

Regards
Anton Erasmus

 
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 11:52 AM.


Welcome!
Welcome to Motherboard Point
 

Advertisment