Re: A86: Hooking interrupt idea


[Prev][Next][Index][Thread]

Re: A86: Hooking interrupt idea



On Sun, 2 Nov 1997, MrManson wrote:

> > What I was referring to was this:  Does it jump to 38H about 200 times per
> > sec, even if you're running an ASM program, with interrupts enabled?  If so, I
> > would think that it would _drastically_ slow it down, or that it would even
> > mess up the registers, etc...
> 
> yeah it seems kind of useless running it all the time, maybe a flag
> turns it off? then again its for protection in programs so maybe not
> 

The interrupt procedure should not slow it down much, since there's not
much to do to handle a timer interrupt.  Besides that, remember that the
processor runs at about 6 MHz, and instructions usually take about 7-15
clock cycles to run.  That's an instruction rate of about 500000 Hz
(right?).  Using even a couple hundred instruction cycles 200 times a
second is still less than 5% of the total instructions executed.

As for turning off the interrupts with a flag, you're right!  The DI
instruction disables interrupts by changing a flag in the processor.  The
            ^        ^
EI instruction does the opposite.

--------
Dan Eble <eble@cis.ohio-state.edu>
         (http://www.cis.ohio-state.edu/~eble)

"Behold, how great a matter a little fire kindleth!" - James 3:5


References: