|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
I need to declare 2 variables at the same address. What's the best way to do this?
extern unsigned char xdata var1; extern unsigned char xdata var2;
xseg at 0x8000 public var1 public var2 var1: var2: DS 1 end
This creates var1 and var2 as 1-byte variables (char or unsigned char) in XDATA at address 0x8000. If you don't want or need to fix the address of the variables, you may create a relocatable segment. For example:
xdata_junk segment xdata rseg xdata_junk public var1 public var2 var1: var2: DS 1 end
Article last edited on: 2005-07-09 09:53:43
Did you find this article helpful? Yes No
How can we improve this article?