4.5 Address Units

Care needs to be exercised when interpreting and working with addresses with the MPLAB XC8 compiler and the MPLAB X IDE.

The MPLAB XC8 compiler always works with byte addresses. Addresses supplied in command-line option arguments or in code constructs like __at(address) must always be byte addresses. Similarly, addresses displayed in output such as map files or memory dumps will always be byte addresses. This might not be the case,however, if you are specifying an address in the MPLAB X IDE Project Properties. The IDE might map word addresses specified in Project Property fields into byte addresses to be used in the compiler build command. If in doubt, check the command line used to build the project in the Output window. Similarly, the MPLAB X IDE displays byte addresses in the Program Memory view window.