[comp.os.msdos.programmer] Fiddling With The Classes To Make Microsoft LINK Do Data Overlays

cramer@optilink.UUCP (Clayton Cramer) (08/11/90)

As you are doubtless aware, Microsoft LINK doesn't do data overlays.
My boss wants me to solve our memory problem by forcing LINK to 
do data overlays.  He wants to fiddle with the .OBJ files so that
the FAR_DATA segments (or at least any constant parts of them) will
be grouped with the CODE segments, causing the const data items to be
overlaid with corresponding code.

Has anyone done this?  Can it be done?
-- 
Clayton E. Cramer {pyramid,pixar,tekbspa}!optilink!cramer
"Our Constitution is color-blind.  The arbitrary separation of citizens,
on the basis of race... is a badge of servitude wholly inconsistent with
civil freedom." -- Justice John Marshall Harlan (1896)

bright@Data-IO.COM (Walter Bright) (08/14/90)

In article <4158@optilink.UUCP> cramer@optilink.UUCP (Clayton Cramer) writes:
<My boss wants me to solve our memory problem by forcing LINK to 
<do data overlays.  He wants to fiddle with the .OBJ files so that
<the FAR_DATA segments (or at least any constant parts of them) will
<be grouped with the CODE segments, causing the const data items to be
<overlaid with corresponding code.
<Has anyone done this?  Can it be done?

The trick would be to give a FAR_DATA segment the same name, group and
class of the particular code segment which will reference it. Put
that code segment in an overlay. The caveat when using it would be that
you can only reference the data *when the overlay is resident*. This can
safely be accomplished by only referencing the data from within the code
overlay that has the same name.

Note that there is no mechanism for reloading data overlays from a far
pointer (aside from Zortech's special handle pointers). The overlays are
only loaded when a function in an overlay is called.