[comp.sys.ibm.pc.programmer] Smart linking of data segments

wsineel@lso.win.tue.nl (e.vriezekolk) (06/05/90)

Hi,

I have a small program which uses a number of 64Kb segements
for data storage. I am using MASM 4.0 and some linkers.
The problem is that my .exe includes all these segments,
though their contents are meaningless at load time.

How can I convince MASM/link that she doesn't have to include
the data segements?

Thanks,
Eelco Vriezekolk.

richgi@microsoft.UUCP (Richard GILLMANN) (06/06/90)

In article <1205@tuewsd.win.tue.nl> wsineel@lso.win.tue.nl (e.vriezekolk) writes:
>I have a small program which uses a number of 64Kb segements
>for data storage. I am using MASM 4.0 and some linkers.
>The problem is that my .exe includes all these segments,
>though their contents are meaningless at load time.
>
>How can I convince MASM/link that she doesn't have to include
>the data segements?

Probably what you want is to allocate the memory dynamically at run
time, by asking DOS for memory blocks.  But you can do what you
are currently doing and EXEPACK the resulting EXE.  EXEPACK will
run encode the EXE and eliminate the redundant info in the EXE file.
EXEPACK is a linker option in recent MS linkers and a separate program
shipped with older language products.

david@csource.OZ.AU (david nugent) (06/06/90)

> In article <1205@tuewsd.win.tue.nl> wsineel@lso.win.tue.nl (e.vriezekolk) writes:

> >How can I convince MASM/link that she doesn't have to include
> >the data segements?
> 
> Probably what you want is to allocate the memory dynamically at run
> time, by asking DOS for memory blocks.  But you can do what you
> are currently doing and EXEPACK the resulting EXE.  EXEPACK will
> run encode the EXE and eliminate the redundant info in the EXE file.
> EXEPACK is a linker option in recent MS linkers and a separate program
> shipped with older language products.


While I agree with the above, I'd just like to alert anyone to a better
alternative.  LZEXE by Fabrice Bellard does full LZW compression with
an extremely fast decompressor.  It is in the public domain (FREEWARE),
and can be used without restriction.

I've found through personal use of LZEXE that it typically reduces the
size of most executables (it can only handle true .EXE files) by more
than 50% - they can even be as small as 4K.  Unlike similar products
(such as SEA's AXE), it doesn't take forever to load - in fact, it
normally loads in around the same speed that DOS would run the raw
executable.

david
-- 
  Unique Computing Pty Ltd, Melbourne, Aust.
  david@csource.oz.au  3:632/348@fidonet  28:4100/1@signet