Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <dos.h>
    void _dos_keep( unsigned retcode, unsigned memsize );

Description:
    The _dos_keep function is used to install terminate-and-stay-resident
    programs ("TSR's") in memory.  The amount of memory kept for the program
    is memsize paragraphs (a paragraph is 16 bytes) from the Program Segment
    Prefix which is stored in the variable  _psp.  The value of retcode is
    returned to the parent process.

Returns:
    The _dos_keep function does not return.

Example:
    #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 );
      }

Classification:
    DOS

See Also:
    _chain_intr, _dos_getvect, _dos_setvect

See Also: _chain_intr _dos_getvect

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson