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
  • Maybe if it is at the end of the last object-File to be linked:

    eofiles.c

    unsigned char last_xdata_byte[1];
    

    eofiles.h
    extenr unsigned char last_xdata_byte[];
    

    Linker-Command-line:
    L51.EXE [all the obj-files to be linked],EOFILES.OBJ
    

    But I'm not absolutely sure about it, so look it up
    in the linker's documentation and verify the result.
    This will NOT work if you use absolute memory locations
    which leave gaps in XDATA. In this case last_xdata_byte
    will be linked into the first gap.

    Maybe this would do:

    eofiles.c (corrected)
    #define MAX_GAP_SIZE 0
    unsigned char last_xdata_byte[MAX_GAP_SIZE+1];
    

    Norbert

Reply
  • Maybe if it is at the end of the last object-File to be linked:

    eofiles.c

    unsigned char last_xdata_byte[1];
    

    eofiles.h
    extenr unsigned char last_xdata_byte[];
    

    Linker-Command-line:
    L51.EXE [all the obj-files to be linked],EOFILES.OBJ
    

    But I'm not absolutely sure about it, so look it up
    in the linker's documentation and verify the result.
    This will NOT work if you use absolute memory locations
    which leave gaps in XDATA. In this case last_xdata_byte
    will be linked into the first gap.

    Maybe this would do:

    eofiles.c (corrected)
    #define MAX_GAP_SIZE 0
    unsigned char last_xdata_byte[MAX_GAP_SIZE+1];
    

    Norbert

Children
No data