Re: A86: Hooking interrupt idea


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

Re: A86: Hooking interrupt idea



Steve86Asm 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...

As Dan pointed out, a _LOT_ of instruction are executed every second
(anyone
want to calculate the average!?) If 10-20 more instructions are executed
every 1/200 of a second, you won't note any difference. That could
easily
be confirmed by making a program that decreases a counter while
interrupts
are enabled and when they're disabled and check the time difference.

It won't mess up the registers either. At the beginning and the end of
the default interrupt handler at 38H the instructions

 EXX
 EX AF,AF'

are executed which swaps AF,BC,DE and HL with their shadow registers.
These instructions are also very fast (compared to push/pop). This
is also the reason you should NOT use the shadow registers in your
program
unless you have disabled the interrupts -the interrupt handler would
destroy them.

-- 
Jimmy Mårdell                "The nice thing about standards is that 
mailto:mja@algonet.se         there are so many of them to choose from."
http://www.algonet.se/~mja    
IRC: Yarin                   "Sanity? I'm sure I have it on tape
somewhere!"


References: