|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: Eliminating 16-Bit Pointer IncrementsInformation in this article applies to:
QUESTIONI am using a pointer to address some custom hardware. The hardware is mapped into XDATA memory and is page aligned. When I increment the pointer, it does a 16-bit increment. Since my hardware is page aligned, I know there is no need to load the upper 8 bits and increment them. Here is the code produced:
Is there anything I can do in C to force this to only do an 8-bit increment? I prefer to stay in the C language. This would save me lots of code space because, as is, every increment takes 8 bytes of code and only the first 2 bytes are required. I cannot declare the pointer as pdata. ANSWERThe following will work:
Code generated for the increment:
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.