|ARM Technical Support Knowledge Articles|
Applies to: AX51 Macro Assembler
Information in this article applies to:
The following code translates fine with A51:
CSEG AT 100H BUFFER: DS 4 LAB EQU BUFFER*4 END
but generates the following error with AX51 and A251:
INVALID RELOCATABLE EXPRESSION
How can I solve that problem?
The problem exists because AX51 and A251 convert the old CSEG/XSEG AT constructs to segments with the OFFS attribute. The base address of these OFFS segments can be defined with the linker CLASSES directive and therefore these segments are still relocateable. Because of this conversion, the rules for Simple Relocatable Expressions apply to your EQU statement.
You may simply change the segment definition to an absolute segment as shown below. However the base address depends on the 8051 device architecture that you use. The following example is for the Philips 80C51MX architecture:
?myseg?1 SEGMENT CODE AT 0x800100 RSEG ?myseg?1 BUFFER: DS 4 LAB EQU BUFFER*4 END
Article last edited on: 2005-07-22 16:27:17
Did you find this article helpful? Yes No
How can we improve this article?