c++ compiling
sov
Posts: 17
ok, I know that this might be the most simple thing to ask but I do not know how to compile c++ code into a propeller chip. Also can you run c++ and spin code at the same time? (or load it into the propeller). Thank you in advance!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
iPhone expert
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
iPhone expert
Comments
There is currently no C++ compiler available for the Propeller, nor is there likely to be anything available in the short term.
In the medium to long term the best chance for getting C++ on the Propeller is probably the ZPU emulator discussed in this thread http://forums.parallax.com/showthread.php?p=878273.
I'm sure heater (the author of the ZPU emulator) will be happy to give you more information. However, even with his solution I do not think you will be able to use C++ and SPIN at the same time.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
The major characteristics of Zog are:
1) Zog is a virtual machine that executes ZPU byte codes. Some like to call it an emulator but as there is no "real" ZPU processor I like to call it a "virtual machine" as they do in the Java world.
2) ZPU byte codes are compiled from C/C++ using the GNU C compiler GCC.
3) Zog (well actually the GCC used) has no libstc++, so there are some missing features like new/delete and exceptions. You are unlikely to actually need those in a small memory constrained system like the Propeller anyway. The effect new/delete can be achieved using malloc if really required or one could implement new/delete if so inclined.
4) You only need a one COG to run the C++ code.
5) You can run larger C++ programs by using external memory as on the TriBlade, DracBlade, Hydra. The external memory is handled by Bill Henning's VMCog virtual memory system so any hardware that supports, soon to be many, can be used. This takes another Cog but for aserious application one could put the ext RAM hardware driver code into the interpreter itself for a one cog and faster solution.
6) Running from HUB expect a little bit slower speed than Spin.
7) Zog can totally replace Spin in a Propeller application. Or...
8) Zog can run along side all your normal Spin code. There is no linkage from Spin to C++ code here. You can't call Spin methods from C++ for example. This is no problem as you can communicate from Spin to C++ through memory in the same way as PASM and Spin do.
9) I'm just now working on adding all Prop specific features to Zog like accessing pins, timers, locks, cognew etc etc.
10) Whilst fairly new and I have not had so much time to work on it Zog seem fairly stable I have been testing it with Dhrostone, RC4 and xxtea crypto etc etc. There are C++ classes that wrap up FullDuplexSerial and VMCog Spin objects (Using only the OASM parts of those objects)
11) In the near future I want to allow for C/C++ programs to start other C/C++ programs or just functions/methods in other cogs as you can in Spin.
You can read about the ZPU processor architecture here opensource.zylin.com/zpu.htm and also download the GCC from there if you want to check it out.
Get the latest (V1.0) version of Zog from the first post of this thread http://forums.parallax.com/showthread.php?p=878273
It will run on any Propeller board and uses the program link as a console terminal. You will have to tweak the clock settings though (both in Spin and C++ at the moment).
Love to hear what you think about it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Post Edited (heater) : 7/18/2010 7:44:03 AM GMT