|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: Mixing Memory ModelsInformation in this article applies to:
QUESTIONI have written the following code:
In the SMALL memory model, the compiler generates assembly code that uses the DJNZ instruction. In the COMPACT and LARGE memory models, it generates codes that doesn't use the DJNZ instruction and appears less efficient. It is important that this function executes as fast as possible, yet I want to use the LARGE memory model. Can I mix the SMALL and LARGE memory models somehow? ANSWERYes. You can use the LARGE memory model for your project as a whole, and specify the SMALL memory model for individual functions. For example you could write the following code:
Be aware that if you do this for reentrant functions, then a separate reentrant stack needs to be initialized for each memory model that has reentrant functions defined. This takes up valuable data memory. MORE INFORMATION
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
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.