PASM to GAS, any more demo than toggle or a cheat sheet?
frank freedman
Posts: 1,983
Hard to find much in the way of GAS examples or info on porting PASM to GAS. Are there any cheat sheets with some of the gotchas i.e. jumps, wait instructions etc, those things specific to the prop only?
Thanks,
Frank
Thanks,
Frank
Comments
If you are trying to write whole modules in GAS (as opposed to in-line assembly), realize that GAS always uses the underlying assembly language for each processor, so GAS *is* PASM for the Propeller. Since I didn't find much in the documentation about this (funny, most people seem to be more interested in "C" for some reason !), I detailed some of my experiences and provided what I think is a useful example in this thread:
http://forums.parallax.com/showthread.php?142441-Native-assembly-files-(*.S)-in-propgcc
Another tidbit: you don't need to worry about the difference in reference due to long vs. byte addressing in cog mode if you simply place the ".cog_ram" directive at the top of your file (as in my example); I much prefer this to using the "mova" pseudo-op.
David Voss
Worked out the issues I was having and now the clock generator function is up and running. It actually is a bit cleaner than the original from when I originally wrote it while learning PASM. Hoping gcc will make some aspects of a project easier to do now that I can use a larger memory model while having speed sensitive functions in cogs. Should possibly finish up porting my parallel ADC object to gcc by tonight, derived from my PASM object in OBEX. After the acq module is ported, need to figure hub access time to see whether concurrent sample transfer during capture or burst mode post capture will be possible.
Thanks for the reply,
Frank
spin2cpp has a --gas output option: if you say: then it will produce a file "foo.S" containing a GAS translation of the DAT section of foo.spin. It's still experimental and probably needs some more work, but it may help with some of the more mechanical aspects of translation (like replacing : labels).
Eric
Thanks again,
Frank
Additional thought:
Currently it should be able to push 100ksps, though if I alter the method for the clock generator, I may be able to push it to over 1Msps.....