PRODUCT : Borland C++ NUMBER : 1007 VERSION : 3.0 OS : DOS DATE : October 19, 1993 PAGE : 1/4 TITLE : Forcing String Literals Into Their Own Data Segment DISCLAIMER The following example routines have been provided by the Technical Support staff at Borland International. They are provided as a courtesy and not as part of a Borland product, and as such, are provided without the assurance of technical support or any specific guarantees. //.................................................................. This document describes a method of forcing string literals to be in a unique data segment and demonstrates it with a simple program. The program declares enough global data to use up DGROUP, and also a string table that would cause DGROUP to overflow. By using the described technique, the string table is placed in a unique segment, and DGROUP is saved from overflowing. The text of the string table describes the technique. To test the technique, break this document into the three modules: farstrs.c strtable.c makefile Then from the DOS prompt, execute make.exe to build the program and run farstrs.exe to prove that it works. Examine the map file to see the proper placement of segment MYSEG, class FAR_DATA, at the beginning of the declaration of the various data segments. //======================================================================== // farstrs.c - the main routine to test the string table //======================================================================== #include extern unsigned far stringCount; // number of strings in the table extern char far *far stringTable[]; // far pointer to far data table char eatMem[ 0xfc00 ]; // eat up space in DGROUP int main() PRODUCT : Borland C++ NUMBER : 1007 VERSION : 3.0 OS : DOS DATE : October 19, 1993 PAGE : 2/4 TITLE : Forcing String Literals Into Their Own Data Segment { int i; for( i=0; i