Function call Overhead in C for HCS12 controller

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

Function call Overhead in C for HCS12 controller

2,308 Views
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
Labels (1)
0 Kudos
3 Replies

586 Views
Vicky
Contributor I
Thanks!!!
0 Kudos

586 Views
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 Kudos

586 Views
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 Kudos