Function call Overhead in C for HCS12 controller

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

Function call Overhead in C for HCS12 controller

3,237 次查看
Vicky
Contributor I
Hi,
I need info on passing parameters in a function call in C for HCS12. How many parameters can be passed in a function call without comprising on performance.

The reason I'm asking this question is: In ARM, upto four words can be passed as a parameter, these paramters are saved in registers for immeidate access and hence avoids using stack and in turn increases the system performance. If more than four words are passed as parameter, they sit in stack. So accessing them takes more cycle and reduces the system performance.

Do we have anything similar to it. So, that we can improve our system performace.


More thoughts and suggestions are welcome.

Thanks & Regards,
Vignesh
标签 (1)
0 项奖励
回复
3 回复数

1,515 次查看
Vicky
Contributor I
Thanks!!!
0 项奖励
回复

1,515 次查看
J2MEJediMaster
Specialist I
If your function call as a fixed set of arguments, the caller pushes the arguments onto the stack, working from left to right (Pascal calling convention). Having said that, if the last argument has a simple type, it is passed to the called code in a register. Consult the HC12_Compiler.pdf file, page 526, regarding the HC(S)12 Backend for more info. This file should be in {Codewarrior_directory}\Help\pdf directory.

---Tom
0 项奖励
回复

1,515 次查看
DanielM
Contributor III
Hi,

the above answer applies to the CodeWarrior compiler. Other compilers are available for S12 as well and these do things differently. Please consult your compiler's docs...

Daniel

Message Edited by DanielM on 2006-11-21 06:50 PM

0 项奖励
回复