Path: utzoo!utgpu!watserv1!watmath!iuvax!uceng!mfinegan From: mfinegan@uceng.UC.EDU (michael k finegan) Newsgroups: comp.sys.ibm.pc Subject: Re: Help this poor, brain-damaged TSR! Keywords: INT 21h TSR Message-ID: <3516@uceng.UC.EDU> Date: 2 Feb 90 03:27:50 GMT References: <6952@jpl-devvax.JPL.NASA.GOV> Organization: Univ. of Cincinnati, College of Engg. Lines: 22 grieggs@jpl-devvax.JPL.NASA.GOV (John T. Grieggs) writes: >I am writing TSR which, among other things, needs to intercept and modify >a couple of the INT 21h calls. The problem is, I can't even seem to chain >INT 21h without horrible side effects! Look at "Advanced MS-DOS Expert Techiniques fo Programmers", Carl Townsend. I don't use turboC (rather MSC), but he uses both. Lots of TSR examples, discussion, etc. Some of the information is 'borrowed' from other sources, (i.e. Computer Language article), but valid. Think about your INT21 vector 'hooking' a little. What register is never used by any INT21 call ? How are you going to save the current state (including flag) ? What registers are used for return values ? I suggest you look at the assembler output (I assume turboC has such an option). In trapping vectors using MSC system calls - I noticed (as others have partially documented) that what I thought (and manual claimed) was happening, was not! Also realize that some registers may be restored, that should pass a value. Result: wrong value passed. mfinegan@uceng.UC.EDU