|
|||||||||||
Technical Support Support Resources
Product Information |
C51: XWORD Macro QuestionsInformation in this article applies to:
QUESTIONWhen using the XBYTE MACRO, my data is stored exactly where it is supposed to be. All works OK. When I use the XWORD MACRO, the data does not go to the specified address. What's happening here? ANSWERThe XBYTE macro is defined to access memory as a large array of unsigned char. For example:
The XWORD macro is defined to access memory as a large array of unsigned int. For example:
XBYTE[100] accesses the BYTE at address 100. While XWORD[100] accesses the WORD at address 200. In a nutshell, the XWORD macro only accesses 16-bit values on even boundaries. The index is NOT the address, but the index of the word. The address is 2 times the index. This is the same as indexing into an array of ints that start at address 0. MORE INFORMATIONSEE ALSOLast 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.