🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms
Article #13371

Re: multiple SEGMENTS, i need to split up my code

#13371
From: Vivek P. Singhal
Date: Sat, 10 Dec 1988 17:02
40 lines
2352 bytes
In article <14349@genrad.UUCP> cig@genrad.UUCP (Charles I. Ganimian Jr.) writes:
>Hello,
>
>	I have a windows question for those of you who have worked
>	with multiple SEGMENTS in a small model program.
>	I need to split my app up into different segments but
>	the C runtime functions used in the code cause linker 
>	errors (L2003 intersegment self-relative fixup) how can 
>	I resolve these	errors so my app can be split up into 
>	different segments.  I have many modules which are already
>	locically grouped with their support functions so having
>	some far functions is not a problem.

When I encountered this error message, I found I was making function
calls across object files without using the FAR keyword.  If you're
able to make function calls within the same object file, but not
across different object files, then you probably have the same
problem.  You should should declare the function as FAR in both its
definition object file and in the object file where it is being used.

If you need more help with multiple-segment small-model applications,
try the Petzold book; I've found it an indispensable reference for
such problems.

By the way, I found the MSC manual was no help on this problem; i.e.
the manual says:

L2003    intersegment self-relative fixup
         An intersegment self-relative fixup is not allowed.

Maybe people at Microsoft find these kinds of error messages helpful,
but I sure don't :-).

Hope this helps...

Vivek
_____________________________________________________________________________
| Vivek Singhal:  vpsingha@athena.mit.edu        474 Memorial Drive         |
|                 vivek@newt.lcs.mit.edu         Cambridge, MA 02139        |
|                 (617) 225-7576                 (617) 621-0405             |
Technical Details
Message-ID: <8392@bloom-beacon.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!bloom-beacon!athena.mit.edu!vpsingha
References: <14349@genrad.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!bloom-beacon!athena.mit.edu!vpsingha
From: vpsingha@athena.mit.edu (Vivek P. Singhal)
Newsgroups: comp.windows.ms
Subject: Re: multiple SEGMENTS, i need to split up my code
Summary: Use the FAR keyword
Keywords: segments
Message-ID: <8392@bloom-beacon.MIT.EDU>
Date: 10 Dec 88 17:02:34 GMT
References: <14349@genrad.UUCP>
Sender: daemon@bloom-beacon.MIT.EDU
Reply-To: vpsingha@athena.mit.edu (Vivek P. Singhal)
Organization: Massachusetts Institute of Technology
Lines: 40