ersmith
01-09-2012, 05:02 AM
Here's an updated version of the spin to C++ translator. This one now understands the OBJ section of .spin files, so it's able to compile real programs. It also has some work-arounds to the FullDuplexSerial issues that I mentioned in the message about the first version of spin2cpp. It's able to compile the unmodified FullDuplexSerial.spin and produce something that works. However, optimization at levels -O2 and above can sometimes produce incorrect results with FullDuplexSerial (I think the work-around for missing volatile is still incomplete).
There's a command line option (-main) to force the output to contain a simple main() that calls the first object method.
In the Demos directory are two samples, Hello.spin and Fibo.spin. Both are complete programs, and can be compiled either by the normal spin compiler (to interpreted spin) or by spin2cpp + gcc (to LMM PASM); Demos/Makefile shows how to do this.
Edited Jan 9: a new version 0.3 is available, see the next message.
Eric
There's a command line option (-main) to force the output to contain a simple main() that calls the first object method.
In the Demos directory are two samples, Hello.spin and Fibo.spin. Both are complete programs, and can be compiled either by the normal spin compiler (to interpreted spin) or by spin2cpp + gcc (to LMM PASM); Demos/Makefile shows how to do this.
Edited Jan 9: a new version 0.3 is available, see the next message.
Eric