Assembly function argument pass

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Assembly function argument pass

787 次查看
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 

标签 (1)
0 项奖励
回复
1 回复

689 次查看
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 项奖励
回复