home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!rsoft!mindlink!a3133
- From: Charlie_Hutchins@mindlink.bc.ca (Charlie Hutchins)
- Newsgroups: comp.os.msdos.programmer
- Subject: Re: Why can't I hook INT 21h???
- Message-ID: <14497@mindlink.bc.ca>
- Date: 22 Aug 92 06:12:45 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Distribution: world
- Lines: 40
-
- > Gregory Humphreys writes:
- >
- > Msg-ID: <1992Aug21.175406.3881@alw.nih.gov>
- > Posted: 21 Aug 92 17:54:06 GMT
- >
- > Org. : National Inst. of Health, DCRT, CSL
- >
- > 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.
- >
- > Okay, lets see you write a short program in C that will do nothing
- > but sit in memory and hook interrupt 21h, returning control to the
- > original INT 21h when it's called. No matter what I try I CAN'T
- > hook INT 21h from C. (TC++ 3.0 anyways). Well? Can you do it? (In
- > TC++ 3.0?)
- >
- >
-