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

assign an absolute memory location

I am kind of confused about using the _at_ keyword to assign a specific address to a variable.

so for example :

extern xdata char variable _at_ 0x000f;

it fills 3 bytes in xram . can any one explain how is the compiler handling these sequence. Thank you !

Parents
  • Jack, Erik,
    I need to apologize to you. My posted test above was wrong in the sense that when using the RealView compiler, one should make the declaration like this:

    extern int variable __attribute__((at(0x8000))) ;
    

    and not like the original version, which was

    extern int variable __attribute__((__at(0x8000))) ;
    

    when the first one is used - no warning is generated!

Reply
  • Jack, Erik,
    I need to apologize to you. My posted test above was wrong in the sense that when using the RealView compiler, one should make the declaration like this:

    extern int variable __attribute__((at(0x8000))) ;
    

    and not like the original version, which was

    extern int variable __attribute__((__at(0x8000))) ;
    

    when the first one is used - no warning is generated!

Children
No data