I'm trying to write 16-bit MS-DOS TSR program with Open Watcom. I've never used Open Watcom before. Actually I've never written a TSR program before but I know the procedure and DOS calls involved.
Open Watcom C Library Reference mentions _dos_keep function to install TSR programs in memory. Here is the example code from the reference:
The example is too simple since I'm going to have several C and ASM source files (I'm going to use the Open Watcom WLINK as a linker). I need to arrange the functions so that transient functions are located last, after C library functions and permanent functions. How to do that?
Open Watcom C Library Reference mentions _dos_keep function to install TSR programs in memory. Here is the example code from the reference:
Code:
#include <dos.h>
void permanent()
{
/* . */
/* . */
/* . */
}
void transient()
{
/* . */
/* . */
/* . */
}
void main()
{
/* initialize our TSR */
transient();
/*
now terminate and keep resident
the non-transient portion
*/
_dos_keep( 0, (FP_OFF( transient ) + 15) >> 4 );
}
The example is too simple since I'm going to have several C and ASM source files (I'm going to use the Open Watcom WLINK as a linker). I need to arrange the functions so that transient functions are located last, after C library functions and permanent functions. How to do that?