C166: Incorrect Address when Initializing a Pointer
Information in this article applies to:
I have written the following code:
However, when I execute this, x points to the location 0x00001 not 0x80001. Why is it only assigning my offset of 0x01 to the pointer address?
Your example uses a 16-bit pointer. When you assign an address above 0xFFFF to a 16-bit pointer, the address is truncated to the lower 16 bits. In this case 0x0001.
You can do one of two things depending on your application.
Last Reviewed: Thursday, February 25, 2021
of your data.