This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

String initialization in xdata

Hi

I am trying to save some code sapce
I used the STRING (XDATA) direcitve to move my constant string to xdata ,I also set my XCONST segment to 0x8000-0x8ffff.
I notice that my code size is smaller but I coul find image that describe the data RAM (including the strings).

Does the LX51 linker produce XDATA image file ?

Here is part of my map file , you can see hat I have to XCONST segments buf I couldnt find the segments in my hex file

any ideas ???

* * * * * * * * * * * X D A T A M E M O R Y * * * * * * * * * * * * *
008000H 008034H 000035H BYTE UNIT XCONST ?XC?MAIN_DEMO
008035H 00805EH 00002AH BYTE UNIT XCONST ?XC?DEBUG
00805FH 008FFFH 000FA1H --- --- **GAP**
009000H 00AF49H 001F4AH BYTE UNIT XDATA ?XD?PRINT
00AF4AH 00AF75H 00002CH BYTE UNIT XDATA _XDATA_GROUP_
00AF76H 00AF8BH 000016H BYTE UNIT XDATA ?XD?MAIN_DEMO

Parents
  • What makes you think there should be a separate "string file"?

    As far as I remember, it all gets put into a single Hex file - so your loader would need to load the "code" address range into your Code RAM, and the "data" address range into your Data RAM. Or you'd have to make your own arrangements to generate separate Code & Data Hex files...

    (when I was doing it, it was all going into a single PROM device - with part of that device mapped into the 8051's Code space, and part into the 8051's Xdata space. But it was a long time ago...)

Reply
  • What makes you think there should be a separate "string file"?

    As far as I remember, it all gets put into a single Hex file - so your loader would need to load the "code" address range into your Code RAM, and the "data" address range into your Data RAM. Or you'd have to make your own arrangements to generate separate Code & Data Hex files...

    (when I was doing it, it was all going into a single PROM device - with part of that device mapped into the 8051's Code space, and part into the 8051's Xdata space. But it was a long time ago...)

Children