[comp.os.msdos.programmer] Dynamically referenced routines

kerbel@bimacs.BITNET (Mark Kerbel) (08/29/90)

(Disclaimer:  I have to do some work on an MS-DOS machine, which I've
never touched before, so excuse any idiotic questions (including my
perpetual "Huh?  I thought any operating system could do that sort of
stuff!" :-) )

What I'd like to do is have some way of dynamically loading a routine.
Essentially, an application (written in Microsoft C) would like to be
able to reference a routine from an external executable.

I've tried to find out how one could reference the address of the
external routine, but my knowledge of the PC's internals is too
limited.

From the Microsoft manuals, I'm guessing that one could spawn() a
main() which would set itself up as an interupt handler (during its
first invocation), and "call" the routine with a software-driven
interupt (via int86(), I think).  Which interrupt number it should be
assigned too (asides from any vacant one) is beyond me.  Besides, using
an interrupt routine to execute straight-forward, sequential code seems
like a kludgy way to go...

I'm not sure whether trying the approach of installing a TSR (via
_dos_keep()) is a more valid approach, but how do I use a TSR once
installed?

If any of you have had experience trying to do this sort of thing,
please email any suggestions.  Hey, if I'm way off, and there's some
extremely easy way of doing what I want, let me know too!  I'll post a
summary if anyone's interested once I get some helpful hints.

(It's times like this that I wish I had shared memory to play with... :-)

Thanks in advance,
-----------------------------------------------------------------------------
Mark Kerbel                                           kerbel@bimacs.biu.ac.il
Guest @ Bar-Ilan University, Israel                   kerbel@bimacs.BITNET