Some time ago I have on boarded on a very ambitious project that I though could be overkill, nevertheless I have persevered in my ambition to prove it is doable. Tired of looking for all kind of OSX IDE solutions for my embedded programming projects, I thought that creating one myself would be a cool idea.
One year later, and mostly due to lack of enough time, I am still at this level[s]:
Which means, almost nothing – well, sort of: logic for preferences in place and some routines for creating new projects… that’s all.
The battle is not finished, yet. And I will not give up, but probably a better planning will be handy. However, as I needed to dig a bit into Assembly language, I have gathered some resources I thought it might be useful to share here. Most of them can be found here, but I will restructure this page with more and more information as I will dive deeper in the topic.
For writing many/ complex assembly functions then I’d recommend a standalone Assembly file for GCC, or an external assembler such as FASMARM.
A very good but old intro to ARM Assembly can be found at http://www.coranac.com/tonc/text/asm.htm. This is a good way to learn the basics of ARM Assembly from scratch.
Another brief introduction about writing ARM Assembly code with GCC can be found at Begin Programming Assembler with GCC. Same resource also has a very good inline assembler cookbook at ARM GCC Inline Assembler Cookbook. This is handy if one is using the GCC inline assembler.
In what regards general Assembly Programming, check the official [instruction set] reference manual on the ARM website, which can be download at ARM and Thumb-2 Quick Reference Card. Please also refer to documentation for specific CPUs. For example, the iPhone 3GS and iPhone 4 both have an ARMv7-A Cortex-A8 CPU, so you download the ARM Architecture Reference Manual ARMv7-A and ARMv7-R Edition (2000 pages long) that tells you exactly which instructions are available and exactly how they work, and the Cortex-A8 Technical Reference Manual (700 pages long) that explains the instruction timing, etc for your specific CPU. There is also a recent ARM Cortex-A Programmer’s Guide, containing useful info and comparisons of Cortex-A8, Cortex-A9, Cortex-A5 and Cortex-A15 CPUs.
It is important to understand that many ARM CPU’s include the NEON Advanced SIMD coprocessor (aka NEON Media Processing Engine), and so if you expect to run operations that can take advantage of SIMD architecture (eg: heavily data parallel tasks), then you should make it a big priority to learn how to use NEON effectively! As mentioned above, the official ARM Architecture Reference Manual and ARM Cortex-A8 Reference Manual are the most important sources of info, but there are other places for quicker info such as:
- The List of NEON Instructions,
- The official ARM Tech Forum,
- An example using NEON for optimization at Hilbert-Space.de,
- Another blog that includes some NEON for iPhone by Wandering Coder,
- An official ARM blog with an intro on NEON at “Coding For NEON,
- ARM’s Fastest memcpy() implementation,
- A forum post with an Even faster memcpy() implementation,
- An experimental ARM Cortex-A8 cycle counter online tool,
- A discussion on How to efficient shrink an image by 50% or 25%,
- Some hints on how to use NEON for Floating Point Optimization and Assembly Code Optimization,
- Many good ARM Assembly links collected by dpt,
- A list of many Bit Twiddling Hacks that might help you reduce some “if” statements in your SIMD code, etc.
Stay tuned. More to come.
Leave a Reply