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

Address allocation in AX51 and C51

Let's say that I have two files in my project: Startup.A51 and test.c

Some variables are allocated in Startup.A51; for example,

REG_STATUS DATA 0A0H

Also, some DATA variables are allocated in test.c.

data char value;

(1) Does the compiler or linker assign the variables to particular addresses (in DATA in this case)?

(2) Does the compiler/linker read the files in a particular order, assigning fixed locations first and then fitting non-fixed ones where ever it can?

(3) Let's say a function is called once at the beginning and then never again. Is the compiler/linker smart enough to reuse those DATA addresses or are they allocated forever?

Thanks for your help!

0