Article View: comp.os.msdos.programmer
Article #1099Re: Why can't I hook INT 21h???
From: Gregory Humphreys
Date: Fri, 21 Aug 1992 17:54
Date: Fri, 21 Aug 1992 17:54
40 lines
2561 bytes
2561 bytes
In article <frank.714406708@fam168>, Frank Hoffmann <fh.pad@sni.de> writes:
|> rmathews@zeus.calpoly.edu (Bob Mathews) writes:
|>
|> >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 ....
|> >[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
|>
|> Same does MSC 5/6. You must write in ASM as well or add additional ASM-Code
|> to restore the regs and the stack-ptr.
IMUST disagree here. I have written numerous similar programs in C and hooking
interrupts is just as reliable in C. There is NOTHING you can't do in C that you CAN in assembley.
|>
|> frank
|> -------------------------------------------------------------------------------
|> __________ Frank Hoffmann
|> / / Siemens-Nixdorf Info. Systems Voice: [+49] 5251 812 209
|> /__ / Dept: AP 52 / SW-Production Fax: [+49] 5251 811 599
|> /' _ _ __ // Fuerstenallee 7 USA: fh.pad@sni-usa.com
|> __/__/__(_(_/ /_/^\__ W-4790 Paderborn / Germany !USA: fh.pad@sni.de
|> -------------------------------------------------------------------------------
|> ( * ) <--- The green dot. This mail is reusable. Copy to /dev/null instantly.
|> -------------------------------------------------------------------------------
--
Greg Humphreys | "Playing not to win is like sleeping with your
gregh@alw.nih.gov | sister - sure, she's a great piece of tail,
| and she's got a bag full of goodies, but it's
(301) 402-1817 | just plain illegal." -Charlie Sheen, "Hotshots"
Technical Details
Message-ID:
<1992Aug21.175406.3881@alw.nih.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!nih-csl!alw.nih.gov!greghReferences:
<14340@mindlink.bc.ca> <1992Aug18.034041.195326@zeus.calpoly.edu> <frank.714406708@fam168>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!nih-csl!alw.nih.gov!gregh From: gregh@alw.nih.gov (Gregory Humphreys) Subject: Re: Why can't I hook INT 21h??? Message-ID: <1992Aug21.175406.3881@alw.nih.gov> Sender: postman@alw.nih.gov (AMDS Postmaster) Organization: National Inst. of Health, DCRT, CSL References: <14340@mindlink.bc.ca> <1992Aug18.034041.195326@zeus.calpoly.edu> <frank.714406708@fam168> Date: Fri, 21 Aug 1992 17:54:06 GMT Lines: 40