Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!seismo!rutgers!mit-eddie!nathan
From: nathan@eddie.MIT.EDU (Nathan Glasser)
Newsgroups: comp.sys.ibm.pc
Subject: Re: DOS Critical-error handler
Message-ID: <6387@eddie.MIT.EDU>
Date: Sat, 25-Jul-87 23:45:56 EDT
Article-I.D.: eddie.6387
Posted: Sat Jul 25 23:45:56 1987
Date-Received: Sun, 26-Jul-87 04:52:07 EDT
References: <1871@isis.UUCP> <1610020@hpcvlo.HP.COM> <872@bsu-cs.UUCP> <6381@eddie.MIT.EDU> <888@bsu-cs.UUCP>
Reply-To: nathan@eddie.MIT.EDU (Nathan Glasser)
Organization: MIT, EE/CS Computer Facilities, Cambridge, MA
Lines: 46


In article <888@bsu-cs.UUCP> null@bsu-cs.UUCP (Patrick Bennett) writes:
>In article <6381@eddie.MIT.EDU>, nathan@eddie.MIT.EDU (Nathan Glasser) writes:
>> In addition, one fact which people don't usually have to think
>> about but is sometimes important is that some/all? calls to Dos
>> functions turn on interrupts (sti) at some point before doing
>> whatever it is they're supposed to do. If your program needs
>                                                         ^^^^^ 
>> to leave interrupts turned off for a period of time during which
>> we also want to set a vector, you can't use the Dos function call.
>Interrupts should ALWAYS be disabled when manipulating interrupt vectors - 
>If interrupts were enabled, one could be called just before you finish
>updating the interrupt vector with the new address - eg. only the segment
>address has been changed.  Well, what if the interrupt you're changing
>were called?  It would have a correct segment address, but the offset would
>place it in the twilight zone...  Common fumble with the timer tick vector...

Thanks alot for misunderstanding me.
I stated early in the quoted article:

(referring to dos interrupt handler setting function)
But since everybody knows that all it does is turn off interrupts (cli)
do the same mov instructions as given in the critical handler
article, and turn them back on (sti), and it is more efficient
to do this directly than doing the Dos function call, people just
do it directly.

I will give you some more information that might help you understand
what I meant in the paragraph of mine that you quoted and decided
was incorrect.

Suppose you are writing some code in which you want interrupts to
be off from point A in the code to point B in the code. Somewhere
in between A and B we just happen to want to set an interrupt vector.
If we use the Dos function call to do this, we will screw ourselves
up, because some/all of the Dos functions turn interrupts at some
point. I have not verified it for this one, but I have seen it
do it for others for which there is no need to turn them on. Thus
the only safe way to do it here is to not use the Dos function.

Is this clear?
-- 
				Nathan Glasser
				nathan@mit-eddie.uucp (usenet)
fnord				nathan@xx.lcs.mit.edu (arpa)
"A tribble is the only love that money can buy."