www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/20/05:35:22

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
To: DJGPP AT DELORIE DOT COM
Date: Wed, 20 Mar 1996 10:20:45 GMT
Subject: Hooking interrupts in djgpp
Message-ID: <8C63F95F0C@fs2.mt.umist.ac.uk>

I know what `hooking an interrupt' is, but is there a routine in djgpp to do
it thus?:-

#include<dos.h>
  int zxcvbnm(Regs&R){blah(); blah(); waffle(); blah();};
/*-----*/
main(){ .........
hook_an_interrupt(0x21,zxcvbnm);

and from here on, any call of an int21 interrupt will do this:-
  Preserve the registers in a `Regs' as described in \djgpp\include\dos.h .
  Call zxcvbnm() with that Regs as its argument.
  If zxcvbnm() returns 0, return to the user program.
  If zxcvbnm() returns non-zero, go to the previous entry address of int21.

  That would be useful.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019