Keil Logo

C51: INITIALIZING XDATA OVER FF00H


Information in this article applies to:

  • C51 Version 5.50

QUESTION

If you set XDATALEN in the STARTUP.A51 file to anything over FF00H, a warning is generated when an attempt is made to assemble the file. How do I fix this?

Also, how do you initialize location FFFFH in XDATA?

ANSWER

The warning indicates that a value is being truncated, and can easily be fixed. Remove the following section from the STARTUP.A51 file:

  IF (LOW (XDATALEN)) <> 0
                MOV     R6,#(HIGH XDATALEN) +1
  ELSE
                MOV     R6,#HIGH (XDATALEN)
  ENDIF

and replace it with:

  IF (LOW (XDATALEN)) <> 0
                MOV     R6,#LOW ((HIGH XDATALEN) +1)
  ELSE
                MOV     R6,#HIGH (XDATALEN)
  ENDIF

It is not possible to initialize location FFFFH in XDATA. In order to do that, you would have to specify an XDATALEN of 10000H which is a 17-bit value. You can modify the STARTUP.A51 file yourself to workaround this problem, or you may initialize that particular location explicitly, either in the STARTUP.A51 file or in your project.

MORE INFORMATION

Last Reviewed: Friday, July 15, 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.