README.md
DOHAND 12-Aug-85

Diagnostic Overlay Handler

* * * P R E L I M I N A R Y * * *

DOHAND may be substituted for the stock low-memory overlay handler to
provide more reliable handling of overlayed programs. DOHAND keeps
track of the subroutine calling chain and checks each subroutine call
to be sure that it will not cause an overlay that will cut the chain.
If a violation is detected, it will print out the segment number and
address of the subroutine that would have caused the violation plus
the segment numbers and addresses of all the subroutines in the
calling chain, and then stop the program.

DOHAND can only monitor subroutines which are located in overlay segments,
because these are the only ones that use the overlay handler. Therefore
DOHAND will not detect the following violation: a subroutine in an
overlay segment calls a subroutine in the root which in turn calls a
subroutine in another segment that will cut the chain. This deficiency
can be avoided if the routines in the root are moved into an overlay
segment (it can be a new one that does not overlay anything else).

DOHAND consists of two parts:

DOHAND.MAC - The overlay handler itself.
DOHLIB.MAC - Subroutines called by DOHAND to keep
track of overlay statistics.

To use DOHAND, first assemble DOHAND.MAC and DOHLIB.MAC, then link your
explicitly with the resulting object files. The linker will automatically
use DOHAND rather than the stock overlay handler. DOHAND normally supports
up to 10 subroutines in the calling chain; if you want more, modify
DOHLIB.MAC as indicated in the source. With support for 10 subroutines,
DOHAND adds about 260 words to your program.

A FORTRAN version of DOHLIB is included in the kit for convenience in
developing your own more sophisticated overlay monitoring procedures.
The FORTRAN version adds considerably to the size of your job, but is
convienient for checking out procedures at a high level before coding
them in MACRO.

A simple example of an overlayed program, OTEST, that has an illegal call
is provided on the kit. All the subroutines in this example do is print
out their name. Armed with a linker MAP, you can easily identify the
subroutine names in the calling chain that lead to a violation in this
program. Print out OTEST.MAP, and run OTEST to see how easy it is.

Robert Walraven
Multiware, Inc.
139 G St., Suite 161
Davis, CA, 95616
(916) 756-3291