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

Specifying Absolute location for more than one array

Hi,
I need to specify absolute location(in code memory) for more than one array, I was successful in implementing for one array as mentioned in Cx51 compilers guide(using BL51 Locate).

What are the steps involed in specifing the absolute location(in code Memory) for more than one array and the procedure to access the content of the specified location.

I would be glad to get advices.

Parents
  • "at" Cannot be used when intilizing the values. One of the method is to use the linker routine(I'm using BL51 Locate).

    Steps I performed:

    1. Created two different array's and saved the array in two seprate files say(FILE1,FILE2).

    2. Made the following settings,
    Options for Target - BL51 Locate.
    In the code Segment specified ?CO?FILE1(Location),?CO?FILE2(Location)

    3. Using CWORD, I also multiplied the index by sizeof(unsigned int)for the macro.

    I'll be glad to know where I'm going wrong

Reply
  • "at" Cannot be used when intilizing the values. One of the method is to use the linker routine(I'm using BL51 Locate).

    Steps I performed:

    1. Created two different array's and saved the array in two seprate files say(FILE1,FILE2).

    2. Made the following settings,
    Options for Target - BL51 Locate.
    In the code Segment specified ?CO?FILE1(Location),?CO?FILE2(Location)

    3. Using CWORD, I also multiplied the index by sizeof(unsigned int)for the macro.

    I'll be glad to know where I'm going wrong

Children
  • "'at' Cannot be used when intilizing the values."

    True - but you didn't mention that you needed the arrays initialised.
    It always helps to give the full details from the start!

    "1. Created two different arrays and saved the array in two seprate files say(FILE1,FILE2)."

    So you've got 'C' arrays - why are you using CWORD?

    You don't need to use CWORD - you just use the array names as normal in your 'C' code!

  • True - but you didn't mention that you needed the arrays initialised.

    Actually, he did mention it implicitly:

    I need to specify absolute location(in code memory)

    Uninitialized arrays in code memory don't make much sense.

  • "Uninitialized arrays in code memory don't make much sense"

    But then neither does using CWORD when you've got a proper 'C' symbolic name...

    Anyhow, the data might've been loaded by some other means than 'C' source initialisation...