Article View: comp.os.msdos.programmer
Article #938Why can't I hook INT 21h???
From: Charlie Hutchins
Date: Mon, 17 Aug 1992 17:41
Date: Mon, 17 Aug 1992 17:41
34 lines
1465 bytes
1465 bytes
Okay, maybe someone could help me here. I am trying to write a TSR
that hooks interrupt 21h but whenever I try and hook that vector I
get an invalid command.com error and my system crashes. I am using
TC++ 3.0 and I have tryed both using their set vect routine as
well as manually changing the interrupt vector table but in both
cases the same thing happens...crash! Even if I write an ISR for
INT 21h that simply returns control to the original ISR the system
crahes. For example, even this crashes my system:
#include <dos.h>
#include <stdio.h>
void interrupt new21handler(void);
void interrupt (*old21handler)();
void main(void)
{
disable();
old21handler=getvect(0x21);
setvect(0x21, new21handler);
enable();
keep(0, 4000);
}
void interrupt new21handler(void)
{
(old21handler)();
}
Anyone know what's wrong here??? As far as I can see this program should
basically do nothing but take up memory but instead, it crahes the system when
run. Any info would be greatly appreciated.
...Charlie Hutchins
Technical Details
Message-ID:
<14339@mindlink.bc.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!ames!agate!rsoft!mindlink!a3133Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!dtix!darwin.sura.net!mips!swrinde!elroy.jpl.nasa.gov!ames!agate!rsoft!mindlink!a3133 From: Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins) Newsgroups: comp.os.msdos.programmer Subject: Why can't I hook INT 21h??? Message-ID: <14339@mindlink.bc.ca> Date: 17 Aug 92 17:41:03 GMT Organization: MIND LINK! - British Columbia, Canada Lines: 34