Go Down

Topic: What is the status of Assembler .S file support? (Read 3352 times) previous topic - next topic


May 27, 2014, 10:28 pm Last Edit: May 27, 2014, 10:30 pm by dcb Reason: 1
I know a lot of folks hate assembler, even many parts of the arduino core go out of their way to even avoid inline (then break when optimization settings or compiler versions change), but that is ideology, not practicality.  There are LOTS of applications where mixing in a little bit of assembler makes a lot of sense, and it isn't just writing compilers.  

My current project (which I have had to sort out in avrstudio, not complaining mind you) creates a token ring-style network that has timing critical code, but also enables one to string 1000+ attinys together, running on internal oscillators (you read that right) and communicate at 400khz with one signal wire between nodes (and majority vote per bit).  Assembler for sending and receiving is the only sane way to eliminate all the other variables and ensure the timing is tight and exact, and future proof it for the hardware in question.

But assembler is tough enough without relying on inline being the only other option, hard to write let alone debug, far better to use something like avrstudio to develop/debug/simulate the gcc assembler file separately.   Also it makes sense to have it as part of a script, and not have to make it part of a library, especially when trying to integrate your assembler file into a prototype that you are still sorting out.

So is there any support for integrating .S files into a project?  I can't make sense out of the checkin comments for 1.5 or the results I'm seeing.  It didn't look like it was a difficult change, I may be wrong, but it ONLY helps enable new possibilities for the arduino platform.  Maybe folks are worried that assembler will get "overused" or something, or some other ideology, but really it is best for a couple global functions where it is actually needed, no reason to write your whole app in it, unless you get really tight on space/etc, and even then it is good to have options to keep you from getting to that point.


The 1.5 added assembler support.  I am not sure how well it is tested.
Because of this I also added assembler support to my arduino eclipse plugin. I never found a volunteer to test.
So for all I know it probably won't work in my eclipse plugin and no idea how it will work in the arduino IDE.
If you want to test take the latest version (there are many improvements in both the latest version of the plugin and the IDE)
Best regards

Do not PM me a question unless you are prepared to pay for consultancy.
Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -


Probably most of the folks willing to experiment in assembler have been discouraged for so long it will take a while before arduino is seen as assembler tolerant.  ARM adds some interesting new variables too (though nothing that can't be handled with a big enough ifdef). 

Of course studio has some essential features for this sort of development, like port stimulation files and step-by-step debugging and monitoring cpu/memory, but I just thought it would be nice to throw those results into arduino easily because the whole thing doesn't need that level of development, nor do the people using it, and since it is alpha, it is easier to share at the project level (cut and paste), I could then easily offload the controller portion of development.  Though there is a lot of marketing influence here too, I'm just doing this for fun, and I find wringing the most value out of minimal hardware "fun" :)

Go Up