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

Sharing data and overlayable segments

I'm using the Keil C51 Tools and have successfully written 8051 programs only in assembly language. Now I need add C code to my assembly program.
After the i add C code to my assembly code Keil C51 has grasped a part of space DATA memory. Now i can not use DATA space for some assembly variables. My C code running in the start programm and i can sharing DATA space _DATA_GROUP_ with my assebly variables. How can i make DATA segments for sharing DATA space between _DATA_GROUP_ and my assembly variables?

Parents
  • I Use for my XPOWYMODN.C
    i assebler code:
    myDATA_DATA SEGMENT DATA OVERLABLE;
    ?XD?XPOWYMODN_MAIN SEGMENT XDATA

    in C code i use XDATA for my C variables.
    Memory map of linker are: DATA 0028H 002AH UNIT _DATA_GROUP_ DATA 0052H 0020H UNIT MYSTACK

    and error
    *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: MYDATA_DATA LENGTH: 001FH
    How can i force the linker to place MYDATA_DATA in address 0028H with length 001FH without error L107?

Reply
  • I Use for my XPOWYMODN.C
    i assebler code:
    myDATA_DATA SEGMENT DATA OVERLABLE;
    ?XD?XPOWYMODN_MAIN SEGMENT XDATA

    in C code i use XDATA for my C variables.
    Memory map of linker are: DATA 0028H 002AH UNIT _DATA_GROUP_ DATA 0052H 0020H UNIT MYSTACK

    and error
    *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: MYDATA_DATA LENGTH: 001FH
    How can i force the linker to place MYDATA_DATA in address 0028H with length 001FH without error L107?

Children
  • Some correcting:

    myDATA_BIT SEGMENT BIT;
    myDATA_DATA SEGMENT DATA OVERLAYABLE;
    mySTACK SEGMENT DATA;
    myDATA_IDATA SEGMENT IDATA;
    myData_XDATA SEGMENT XDATA;

    in C code i use XDATA for my C variables.
    Memory map of linker are:

    DATA 0028H 002AH UNIT _DATA_GROUP_
    DATA 0052H 0020H UNIT MYSTACK

    and error

    *** ERROR L107: ADDRESS SPACE OVERFLOW SPACE:
    DATA SEGMENT: MYDATA_
    DATA LENGTH: 001FH

    How can i force the linker to place MYDATA_DATA in address 0028H with length 001FH without error L107?