🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #391

Re: Why can't I hook INT 21h???

#391
From: Bob Mathews
Date: Tue, 18 Aug 1992 03:40
17 lines
1287 bytes
Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins) writes:
>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:
[code deleted]

The turbo c interrupt function automatically saves all cpu registers.
The return values from DOS are getting clobbered.  Code like this
absolutely needs to be written in assembly.  You need to have complete
control of what's happening to the machine.

swehtam bob
Technical Details
Message-ID: <1992Aug18.034041.195326@zeus.calpoly.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!nic.csu.net!koko.csustan.edu!rat!zeus!rmathews
References: <14340@mindlink.bc.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!nic.csu.net!koko.csustan.edu!rat!zeus!rmathews
Newsgroups: alt.msdos.programmer
Subject: Re: Why can't I hook INT 21h???
Message-ID: <1992Aug18.034041.195326@zeus.calpoly.edu>
From: rmathews@zeus.calpoly.edu (Bob Mathews)
Date: Tue, 18 Aug 1992 03:40:41 GMT
References: <14340@mindlink.bc.ca>
Organization: California Polytechnic State University, San Luis Obispo
Lines: 18