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

"remainder of xdata"

I have a need for making a buffer, the size of which is as large as possible. I know how to do that in assembler; however, not in C. Two ways would work:

1) a pointer to the end of used xdata
2) an array my_array[MAX]

I much prefer method #1, but any method that will give me the desired result will be appreciated.

Thanks,

Erik

Parents
  • Hi eric,

    as far as I know reordering only applies to
    modules, compiled by C51.

    The ORDER-directive turn off reordering:

    #pragma ORDER
    

    However I referred to the ordering of segments:
    the suggested modul only contains 1 symbol, so
    the ordering of this Symbol within it's segment can
    easily be predicted :)

    The Linker processes the OBJ-Files "in the order
    in which they are specified on tthe command-line"
    .
    So the symbol's segment will be processed last if it is
    specified last. The maual doesn't exactly state, that
    it will be allocated last if it is processed last, but I guess
    you can assume this.

    Norbert

Reply
  • Hi eric,

    as far as I know reordering only applies to
    modules, compiled by C51.

    The ORDER-directive turn off reordering:

    #pragma ORDER
    

    However I referred to the ordering of segments:
    the suggested modul only contains 1 symbol, so
    the ordering of this Symbol within it's segment can
    easily be predicted :)

    The Linker processes the OBJ-Files "in the order
    in which they are specified on tthe command-line"
    .
    So the symbol's segment will be processed last if it is
    specified last. The maual doesn't exactly state, that
    it will be allocated last if it is processed last, but I guess
    you can assume this.

    Norbert

Children
  • "but I guess you can assume this"


    That's the problem, I will not make something that may fall apart when Keil releases a new version.

  • Voilà one Reason, why we still use C51 V5.10.
    We are afraid of surprises.

    By the way:
    The assumption is definitely true for the combintion
    of partial code-segments (i.e. constant data in code).
    This is a feature on which Keil itself relies with their
    variable initialization routine ?C_START: a trailing zero
    linked at the end of ?C_INITSEG stops the initialization.
    It is also documented, that the customized STARTUP.A51's
    object file must be the last object file to be specified in
    the command-line.

    By the way. I think I remember that you've said, you have
    an assebler-solution to your problem. But to me this seems to
    be a linker problem, rather than a translator problem.

    So: How do you do it with the assembler?

    Norbert.