[comp.os.msdos.programmer] Overlays, how is it done and can it be done with TC?

rfrost@spam.ua.oz.au (Richard Frost) (08/30/90)

This topic MUST have been talked about before but I am a newcomer to
this group.

How are overlays done exactly (I'd like info on _implementation_ as I know
the theory).

Can I implement them with purely C code? (ie. do I need assembly code 
to assist etc?)

What compilers support overlays? I have read the Turbo C manual and it
does not mention overlay support anywhere.

Thanks.
--
______________________________________________________________________________
_          ___       | Email Address:  rfrost@spam.ua.oz.au
I)         I_        |
I\ ichard  I rost    | FidoNet (ADAM LINK BBS): 3:680/805 Richard Frost
---------------------+--------------------------------------------------------
Bewildered Earth Scientist: "How do you re-wire alien equipment like that??"
Dr. Who: "Its easy when you've had 900 years experience in alien technology."
______________________________________________________________________________

richw@hplsla.HP.COM (Rich Wilson) (08/31/90)

/ hplsla:comp.sys.ibm.pc.programmer / rfrost@spam.ua.oz.au (Richard Frost) /  6:44 am  Aug 30, 1990 /

This topic MUST have been talked about before but I am a newcomer to
this group.

How are overlays done exactly (I'd like info on _implementation_ as I know
the theory).

Can I implement them with purely C code? (ie. do I need assembly code 
to assist etc?)

What compilers support overlays? I have read the Turbo C manual and it
does not mention overlay support anywhere.

Thanks.
--
______________________________________________________________________________
_          ___       | Email Address:  rfrost@spam.ua.oz.au
I)         I_        |
I\ ichard  I rost    | FidoNet (ADAM LINK BBS): 3:680/805 Richard Frost
---------------------+--------------------------------------------------------
Bewildered Earth Scientist: "How do you re-wire alien equipment like that??"
Dr. Who: "Its easy when you've had 900 years experience in alien technology."
______________________________________________________________________________
----------

Turbo C++ lets you do overlays with VROOMM. It sounds easy from the
manual (I haven't tried it). Just some compiler flags, link commands,
and simple rules to follow.

Rich Wilson

P.S. I'd be interested in a technical description of how the overlays
are implemented; i.e. what instructions get executed when a call to
or return from a function is executed?

emmo@moncam.co.uk (Dave Emmerson) (09/02/90)

In article <RFROST.90Aug30231412@spam.ua.oz.au>, rfrost@spam.ua.oz.au (Richard Frost) writes:
> 
> This topic MUST have been talked about before but I am a newcomer to
> this group.
> 
> How are overlays done exactly (I'd like info on _implementation_ as I know
> the theory).
> 

If you use the TC++ integrated environment, it couldn't be much easier.
Select overlay support on the compile options, and tag the file(s) to be
overlaid in the project file list (a simplified Make file) and build all.
As I recall, TC2.0 didn't support overlays at all. If it did I didn't notice,
I didn't need them till recently. Problems? None so far which weren't of my
own making. Criticisms? One : Why can't I save the debug list out to a file?
retyping them everytime I crash is a real pain. The rest is so well polished
that this stands out like the proverbial sore thumb. Did I miss something?
I HAVE checked all the yellow/red manuals...

Dave E.

Disclaimer : no connection etc...

hollen@megatek.UUCP (Dion Hollenbeck) (09/04/90)

In article <RFROST.90Aug30231412@spam.ua.oz.au>, rfrost@spam.ua.oz.au (Richard Frost) writes:
> 
> This topic MUST have been talked about before but I am a newcomer to
> this group.
> 
> How are overlays done exactly (I'd like info on _implementation_ as I know
> the theory).
> 
Most of the suggestions have been to go to TC++, which might be fine
for some, but some of us do not want to deal with C++, nor do we
need to pay $$ more to get features we do not want or need.  There
is a solution for TC 2.0x and it is the book 

Extending Turbo C Professional 
Al Stevens 
1989
ISBN 1-55828-013-8
Management Information Source Press
P.O. Box 5277
Portland, Or.   97208-5277
(503)282-5215


In this book, Al Stevens gives source code for "The Poor
Man's Overlay Manager (PMOM) and extensive descriptions
of how things work.  I have not used them, but many of
the other things which I have used from the book have
been quite helpful and accurate.  The book comes with a
disk with all the source code, or sold without for
slightly less $$.

"PMOM is a technique for building a set of programs
where a root module executes overlay modules..."  "The
overlay module can process data space in the root and
can execute functions in the root.  The root executes
the overlay by using the Turbo C spawnvp function.  The
root uses the command line parameter mechanism to pass
ASCII representations of far pointers to data items and
functions in the root.  The overlay program translates
those ASCII far pointers into true far pointers and can
then read and write aprays, structures, strings,
integers, and any other data items that the root tells
the overlay about.  The overlay translates the ASCII
function pointers into true functions pointers and can
thus call functions in the root."

This technique could be simplified by passing pointers
to arrays of functions or arrays of data pointers.
Programs needing to use these would be compiled with
common offset definitions for these functions/data
items.

	Dion Hollenbeck             (619) 455-5590 x2814
	Megatek Corporation, 9645 Scranton Road, San Diego, CA  92121

        uunet!megatek!hollen       or  hollen@megatek.uucp

-- 
	Dion Hollenbeck             (619) 455-5590 x2814
	Megatek Corporation, 9645 Scranton Road, San Diego, CA  92121

        uunet!megatek!hollen       or  hollen@megatek.uucp

dougs@videovax.tv.tek.com (Doug Stevens) (09/05/90)

In article <699@jeff.megatek.uucp>, hollen@megatek.UUCP (Dion Hollenbeck) writes:
> Most of the suggestions have been to go to TC++, which might be fine
> for some, but some of us do not want to deal with C++, nor do we
> need to pay $$ more to get features we do not want or need ...
>

I would make the move to TC++ even if you don't immediately want support
of C++. The improvement in the entire environment alone is well worth
the money. And then, when you finally do want object support, you'll
already have a familiar environment and fast compiler.

		-- A biased but VERY satisfied Turbo-C++ user --