Assembly function argument pass

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Assembly function argument pass

788 Views
frank涛李
Contributor II

Hi NXP,

I'm coding assembly language on MK66FN2M0VMF18 processor.When I code a function in C format named uint8_t(uint8_t Address,uint32_t Data,uint8_t *p),and then the function will be called in the C source file.I want to know where the three arguments 'Address' 'Data' 'p' would be passed to in MK66FN2M0VMF18's registers.The store registers decide my assembly language.Can you give me some related docs or links?

Best regards,

Frank 

Labels (1)
0 Kudos
Reply
1 Reply

690 Views
carlos_neri
NXP Employee
NXP Employee

ARM parameter passing rules states that you should use R0 - R3 for paramenters. If you need to pass more than 4, then, use the stack:

http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042f/IHI0042F_aapcs.pdf 

For parameter returns, you should use R0.

0 Kudos
Reply