|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
Is there a way to determine, at runtime, the last used location in xdata? I want to use the remaining xdata space (beyond the last xdata variable allocated) as a small heap.
One way to do this is to create a file containing only an xdata variable declaration. For example:
xdata unsigned char last_var_used;
When you create your project, make sure that this is the last file in the project file list. When the project is linked, this file will be linked last AND the last_var_used variable will be located at the end of xdata memory.
You may use the C address-of operator ('&') to get the address of this variable.
Article last edited on: 2002-02-18 00:00:00
Did you find this article helpful? Yes No
How can we improve this article?