Shop OBEX P1 Docs P2 Docs Learn Events
Linking with .binary file with ICC — Parallax Forums

Linking with .binary file with ICC

ImageCraftImageCraft Posts: 348
edited 2008-10-03 22:40 in Propeller 1
As you may know, currently if you want to include a PASM style driver code with your C project, you either have to convert the code to our asm format (not hard, the instructions are standard Propeller's) or you convert the code to a hex array and then initialize a C array with its content. Then you would use the library function coginit_native(symbol_name,...) to invoke the code in another Cog.

We now offer another alternative: you can directly use a .binary file generated from the Spin tool for your PASM code. If you want to beta test this, please do the following:
- Install our demo compiler if you don't already have it installed
- make a copy of c:/program files/iccv7prop/bin/ilinkprop.exe since this will replace it
- grab http://www.dragonsgate.net/pub/BETAS/ilinkprop.exe and put it in the bin directory
- grab the attachment to this post. It contains a test project that toggles a pin on the demo board
- Open the project and build!

Doing it yourselve:
- The Spin code must be stripped: it can contain only one PUB area (which can be empty or not) and a DAT segment with the asm code.
- You would need to run the Spin tool yourself to generate the .binary file.
- You add the flag
-bin%<file.binary>%<symbol>

to the Project->Options->Target->"Other Options" (lower right) to include the file. The "symbol" is the symbol name you bound the code to, and to follow the calling convention, it usually has a prepended underscore. For example, in the example project, you'd see:

-bin%ToggleFinite.binary%_Toggle

Let me know how it works and whether you think this would be useful. The hope is that this will make it easier for people to port the asm driver to our environment.


****
And now for something slightly different: we are making good progress with adding 32 bits floating point support (*). We have implemented the basic float32 bits code (add/sub/mul/div/etc.) in a separate Cog and activated the CLib Cog interface. Codegen mod has started, and I expect we should be able to beta test by the end of October if not sooner.

(*) 64 bits floating point is very slow. We could do it, but the cost vs. benefit is not high.


As always, I welcome your suggestions and comments.
// richard

Comments

  • RaymanRayman Posts: 14,364
    edited 2008-10-03 22:40
    Very nice!· I'm about to plunge into ICC land...· This will definitely make things easier for me.
Sign In or Register to comment.