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
  • You were referring to a declaration that contains non-standard keywords, and basically by definition the standard cannot describe what the compiler should do with such a line.

    You are missing the point. The issue in hand is that the 'extern' keyword, when applied to a variable definition, does not make it an "extern ref".

    Interestingly enough, the compiler documentation contains detailed examples on how to define variables using the _at_ keyword, and how to use these variables in a different source file than they were declared in.

    I should hope the manual documents the usage of all non-standard extensions.

Reply
  • You were referring to a declaration that contains non-standard keywords, and basically by definition the standard cannot describe what the compiler should do with such a line.

    You are missing the point. The issue in hand is that the 'extern' keyword, when applied to a variable definition, does not make it an "extern ref".

    Interestingly enough, the compiler documentation contains detailed examples on how to define variables using the _at_ keyword, and how to use these variables in a different source file than they were declared in.

    I should hope the manual documents the usage of all non-standard extensions.

Children
No data