This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Declare 16-bit pointer compiletime

To support a legacy structure I need a 16-bit pointer. This to create a linked-list sort of structure. I need this to be declared compile-time, not runtime.
Previously, we did this in assembly using Keil C166.
The resulting pointers should be located in flash.

Example (pseudo code):

const int Temp = 123; unsigned short Ptr16 = (unsigned short)&Temp; // Doesn't work

This doesn't work: error: #69: integer conversion resulted in truncation

Any ideas how this could be done?