Function call Overhead in C for HCS12 controller

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Function call Overhead in C for HCS12 controller

3,167件の閲覧回数
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,445件の閲覧回数
Vicky
Contributor I
Thanks!!!
0 件の賞賛
返信

1,445件の閲覧回数
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,445件の閲覧回数
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 件の賞賛
返信