ARM Technical Support Knowledge Articles

INVALID RELOCATABLE EXPRESSION WITH CSEG/XSEG AT

Applies to: AX51 Macro Assembler

Answer


Information in this article applies to:


SYMPTOMS

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?

CAUSE

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.

RESOLUTION

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

MORE INFORMATION

Article last edited on: 2005-07-22 16:27:17

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential