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' key word cannot be used."

    Why not?

    "I'm unable to retrive the values when the address is specified as the index to the 'CWORD'"

    Then you're doing it wrong!

    How are people supposed to help if you don't supply any details??

    Post the smallest, complete, compilable example that illustrates your problem.

    Describe what you think it should do, what actually happens, and what you have done so far to try to explain the difference.

    Follow the instructions for posting code:
    http://www.keil.com/forum/tips.asp

    Use copy & paste - do not re-type!

Reply
  • "'at' key word cannot be used."

    Why not?

    "I'm unable to retrive the values when the address is specified as the index to the 'CWORD'"

    Then you're doing it wrong!

    How are people supposed to help if you don't supply any details??

    Post the smallest, complete, compilable example that illustrates your problem.

    Describe what you think it should do, what actually happens, and what you have done so far to try to explain the difference.

    Follow the instructions for posting code:
    http://www.keil.com/forum/tips.asp

    Use copy & paste - do not re-type!

Children
  • "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

  • "'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...