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

define a constant to an absolute address

How to define the following constant to an absolute address at 0x1000?

unsigned char code index[] =
{
  0x3,
  0x5,
  0x6
} ;    //a constant mem in a file


Thanks for any help!

Parents
  • Create a separate source file for your array, for example "myarray.c".

    Under the "LX51 Locate" tab in the target options dialog put "?CO?MYARRAY(C:0x1234)" in the "User segments" box. Substitute your desired address where I put "0x1234".

    It's a real pity one can't just use the _at_ keyword with initialisers, isn't it?

    Stefan

Reply
  • Create a separate source file for your array, for example "myarray.c".

    Under the "LX51 Locate" tab in the target options dialog put "?CO?MYARRAY(C:0x1234)" in the "User segments" box. Substitute your desired address where I put "0x1234".

    It's a real pity one can't just use the _at_ keyword with initialisers, isn't it?

    Stefan

Children