Keil Logo

AX51: INVALID RELOCATABLE EXPRESSION WITH CSEG/XSEG AT


Information in this article applies to:

  • AX51 All Versions
  • A251 All Versions

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

  • Refer to BSEG in the Ax51 User's Guide.
  • Refer to CSEG in the Ax51 User's Guide.
  • Refer to DSEG in the Ax51 User's Guide.
  • Refer to ISEG in the Ax51 User's Guide.
  • Refer to XSEG in the Ax51 User's Guide.

Last Reviewed: Friday, July 22, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.