cancel
Showing results for 
Search instead for 
Did you mean: 

handling function parameters in assembly

lowpowermcu
Associate II
Posted on October 20, 2010 at 22:57

handling function parameters in assembly

2 REPLIES 2
Posted on May 17, 2011 at 14:12

First the first 4 parameters use ARM registers, they will be R0, R1, R2, R3, others will be pushed on the stack, local variables can either be in registers or relative to the stack frame. A 32-bit return value will be returned in R0. Look at the code generated by the compiler to get some worked examples.

You want to review the

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.swdev.abi/index.html

and specifically the

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

http://www.codesourcery.com/sgpp/lite/arm/portal/kbentry32

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
lowpowermcu
Associate II
Posted on May 17, 2011 at 14:12

Thanks clive1