Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - 3906 segment exceeds 64 k http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 3906                Segment exceeds 64 K
------------------------------------------------------------------------------
 Description
   This error indicates that the data or code segment for the current
   module has reached the limit of 64 K, which is imposed by the segmented
   architecture of the computer's memory.

   An easy way to make the data segment full is to declare public or static
   variables whose combined size reaches the limit, like:

   vardef
      char aBig[ 255 ]  // size is 65280 bytes
      char cString      // size is   256 bytes
   enddef

   Literal strings defined in the code (like ? "hello") also add to the
   size of the global data segment.

 Solution
   Optimize the data segment usage by the following means:

   - Declare repetitive literal strings as variables and reuse them.

   - Use the -Gf compiler switch to relocate all string literals in a far
     data segment.

   - Use local variables whenever possible instead of publics and statics.

   - Place coherent blocks of displayable strings in text blocks that are
     stored out of the data segment.

   - Store large amounts of text data in database or other files and read
     them to memory when necessary.

   If the code segment is full, then split the module into smaller ones.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson