On Tue, 2009-04-28 at 15:06 -0700, John Farmer wrote: > Hi Ian thanks for the reply, > > I had a good look through the ARM-THUMB Procedure Call Standard and it sort > of suggests that R7 could be used as a frame pointer. Looked through the GCC > docs and found the -fabi option but it appears to apply to C++ code. > The ARM-THUMB Procedure Call standard was superseded by "The ABI for the ARM Architecture" nearly 5 years ago now, you can obtain the most recent documents from the ARM documentation website: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.set.swdev/index.html The current PCS is supported in gcc by several configurations (most of which have 'eabi' somewhere in the configuration name; for Cortex-m3 I strongly recommend you use one of those configurations. You might also want to configure the compiler with "--with-isa=thumb" and "--with-cpu=cortex-m3"; this will save you from having to modify your configure scripts or compiler command lines every time you build some code. > I am still wondering what makes the decision to use R7 as the frame pointer. > If its used because of an ABI standard for the ARM Cortex-M3 CPU how is it > specified to GCC? Also if this is the case is there a standard that I could > look through? I have looked on the ARM web site but not found it yet. The procedure call standards do not specify a frame pointer any more (and haven't for nearly 15 years -- ie since Thumb was added to the architecture). So any compiler using a frame pointer is free to use whatever register is wishes to. In thumb you want to avoid using a frame pointer whenever possible since non-stack based addressing is severely limited in the offsets that are permitted. R.