|
|||||||||||
|
Technical Support Support Resources
Product Information |
GENERAL: USING REGISTERS WHEN CALLING AN ASSEMBLER FUNCTIONInformation in this article applies to:
QUESTIONI am calling an assembler function foo from the main function in C and the compiler avoids using registers in the main function for operating on local variables. When I comment out the function call it uses the registers. How can I make the compiler use the registers to obtain smaller and faster code? ANSWERIn your assembler function you need to specify which registers are modified by the function. In addition you need to turn global register optimization on. Modify your assembler code to use the REGUSE directive. For example: $REGUSE foo (ACC, R0) will specify that the function foo only modifies the accumulator and R0. To turn on Global Register Optimization, choose Make from the Options menu in µVision. Click on the Misc tab and check the 'Register Optimization' option. MORE INFORMATION
FORUM THREADSThe following Discussion Forum threads may provide information related to this topic. Last Reviewed: Friday, July 27, 2001 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.