PreviousNext
Direct function parameter usage
Help > Appendix > Code Optimization > Direct function parameter usage

FLASH-                        RAM-               Speed+

 

It is advisable to use a variable that maps exactly the fixed-function parameter (when available or when intentionally implemented to save RAM) at a function call to avoid useless data moves between the variable and the respective parameters. For instance, startLongDelay maps a parameter ticks to the param3 system variable.

 

uns16 delay;

delay = (uns16)RTDT0 * RTDT1;

startLongDelay( delay );

uns16 delay @ param3;

delay = (uns16)RTDT0 * RTDT1;

startLongDelay( delay );