PASM and gcc-asm syntax difference
macca
Posts: 783
in Propeller 1
Hi,
I'm writing a driver source using gcc-asm instead of spin/pasm and I found that there is a little syntax difference:
With spin/pasm, if I write:
It works and writes the longs readed from hub memory to the location var_base and var_base+1, however the same code compiled with gcc-asm doesn't work, I think it takes only the first part (var_base) and ignore the addition and all results are written to the same location.
The obvious fix is to explicitly name the destination locations, however I wonder if this is a known issue, or there is a different syntax to do the same?
I'm writing a driver source using gcc-asm instead of spin/pasm and I found that there is a little syntax difference:
With spin/pasm, if I write:
rdlong var_base, ptr add ptr, #4 rdlong var_base + 1, ptr
It works and writes the longs readed from hub memory to the location var_base and var_base+1, however the same code compiled with gcc-asm doesn't work, I think it takes only the first part (var_base) and ignore the addition and all results are written to the same location.
The obvious fix is to explicitly name the destination locations, however I wonder if this is a known issue, or there is a different syntax to do the same?
Comments
Also, this stuff has been changing in recent versions of PropGCC, so it will help if you can tell us exactly which version of propeller-elf-as you are using.
In my source I have ".cog_ram" and ".compress off" directives already.
The gcc version is:
This does require a more recent version of the binutils package than the one that comes with SimpleIDE. In fact PropGCC has changed a lot since the 1.0.0 release, but for whatever reason SimpleIDE is not being updated with new versions. You can build it from source, of course (David Betz has a nice top level repository for this at https://github.com/dbetz/propeller-gcc). I think David Zemon has recent PropGCC binaries available from his PropWare page (look under "Useful Links" on http://david.zemon.name/PropWare/).
Just to clarify, in my source file I have the following header:
I've fixed that, and builds done after today should have .pasm working correctly.
Thank you all.