Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_dos_setvect() set an interrupt vector value</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _dos_setvect()          Set an interrupt vector value

 #include   <dos.h>

  void    _dos_setvect(intnum, void (handler)());
  unsigned intnum;                 Target interrupt vector
  interrupt far *handler;          Replacement interrupt handler for intnum

    _dos_setvect() uses MS-DOS function 25h to change the value of
    interrupt vector 'intnum' to the address of the function that
    'handler' points to. Then, when interrupt 'intnum' is invoked the
    replacement function handler will be called instead of the original.

      Notes:    If 'handler' is the address of a C function, it must be
                declared with an interrupt attribute (the interrupt
                attribute is not part of standard C syntax). If an
                assembly handler is used, it must satisfy the
                requirements for an interrupt-handling routine.

                The interrupt attribute tells the compiler to generate
                entry and exit sequences that are appropriate for an
                interrupt-handling function, including saving and
                restoring registers and executing an IRET instruction to
                return.

   Portability:     MS-DOS only, version 1.0 or higher


See Also: _dos_getvect() _dos_keep()

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