|C interpreters for devices with embedded software M.Polak@adbglobal.com (Michal Polak) (2002-05-17)|
|Re: C interpreters for devices with embedded software Dave.Dunfield@use.address.from.sig (2002-05-23)|
|Re: C interpreters for devices with embedded software email@example.com (Yiorgos Adamopoulos) (2002-05-23)|
|Re: C interpreters for devices with embedded software firstname.lastname@example.org (2002-05-27)|
|From:||Dave.Dunfield@use.address.from.sig (Dave Dunfield)|
|Date:||23 May 2002 01:23:24 -0400|
|Organization:||Dunfield Development Systems|
|Posted-Date:||23 May 2002 01:23:24 EDT|
>I am thinking of doing a port of an embeddable C interpreter and link
>it with an embedded software running on a device. The main aim to is
>be able to carry out tests of the embedded software. The C programming
>language would be the most preferable. The C "scripts" would be
>uploaded onto the device with embedded software through e.g. a serial
>Have ever anybody dealt with such a task? In particular, I mean about
>the C interpreters that seems to be most suitable for these needs
>(easy to port, small memory requirements, etc).
>[Why do you want C to be your scripting language? It's not a wonderful
>candidate for an interpreter. -John]
John's right that C is not a "wonderful candidate" for an interpreter,
especially if small size and simplicity are a goal.
Depending on your requirements, an approach I've used for scripting in
several small systems may work for you.
I designed a tiny "virtual machine" with an instruction set highly
suited to be a target of my compiler. I then ported a code generator
for the compiler which outputs code for the VM.
On most small CPU's the VM interpreter is about 1k in size, and
provides all the run-time benefits of an interpreter such as the
ability to control, limit and/or translate accesses to various memory
blocks, devices etc. I use a concept of virtual I/O devices to
communicate between the virtual machine and whatever system it has
been integrated into.
It won't work for you if you need to use "text stripts", ie: you want to
connect via a TTY connection and enter your program like you
would into a BASIC intepreter. Using the VM approach, the "scripts"
you load into the system are small binary format "programs".
For more information on my implementation, lookup "C-FLEA" on
dave@ Dunfield Development Systems http://www.dunfield.com
dunfield. Low cost software development tools for embedded systems
com Software/firmware development services Fax:613-256-5821
Return to the
Search the comp.compilers archives again.