Simple Spin to PASM converter?
Philldapill
Posts: 1,283
I'm great on Spin, but have no experience on PASM. I'm not sure if it's been done before, but is there a fairly simple spin to PASM converter software? I'm not sure how hard it would be to do, but could a pre-interpreter be made that would turn spin code into assembly BEFORE it's loaded? this way, it seems the spin code that is written would run faster(maybe not as fast as specific assembly) once it's loaded into ram?
Comments
You'll have to learn PASM. There are some tutorials. Look in the "sticky threads" at the top of the Propeller forum.
You could try ImageCraft's C compiler. It includes an assembler. Demo mode allows you to compile small programs (up to 4K) after the 45 day demo period is up. The C is compiled into specialized assembly code called LMM (large memory model) code which does require a small interpreter in the active cogs, but it is much faster than the Spin interpreter.
Post Edited (Mike Green) : 6/16/2008 2:38:47 AM GMT
However, I still wonder - would it be impossible to make a spin to PASM converter?
It's also possible to convert Spin byte codes to PASM. Again, it's a lot of work to do a good job.
Neither of these are easy projects.
LMM is a half-way house, quickly interpreting most PASM opcodes, but taking longer over other 'virtual opcodes' which are interpreted like Spin bytecodes are to deliver object and stack handling without bloating the program size. Just as C can be converted to LMM so too can Spin if someone were to take on the effort to do that.
To compile to pure PASM would not really make as much sense unless it were to compile a very limited sub-set of Spin and then you'd lose most benefits which make Spin attractive in the first place, and not least you'd be limited to just 496 generated PASM instructions. If you need more than that you have to go to LMM anyway.