To becom familiar with the MOACON, I have ported a little C interpreter to run on the controller. It is not exremely robust (no pre/post increment/decrement, pointers, and only int and char variables), but it does support looping and functions. Scripting is now possible on the MOACON!
The code for this C interpreter is ported from the interpreter described in the Dr. Dobbs Journal Article "Building Your Own C Interpreter"
on the web at http://drdobbs.com/cpp/184408184.
I added some additional "library" functions in the file lclib.c for things such as relay output, digital input, lcd ouput, etc. Additional modifications are encouraged! If you modify the source, whether to add a feature or fix a bug, please share the code!
Note that the code makes use of the syscalls.c file located in the directory <MOACON STUDIO INSTALL DIRECTYR>\$CFC files\ARM\io_putchar.
You will need to modify the parser.csp file to point to the file on your system.
Enjoy!
Rick Howard
Exquadrum, Inc.