TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: SYLVAIN LAUZON
from: GLEN MCNABB
date: 1997-03-15 15:41:00
subject: Re: Unknown function

Hi Sylvain,
SL> This is the part of an hooked int
8< snipped
SL> Some text files said to enable interrupts inside the interrupt. I know
SL> some interrupt can be long enough especially int 21h and can slowing down
SL> things.
SL> I need to know how the computer executes tasks in memory with resident
SL> programs. Someone can pictured this here?
It really depends on the TSR in question. (what it does)
Lets use an example... Suppose you have a pop-up calculator TSR....
It is likely to chain into the keyboard interupt... When the keyboard
interupts the processor, the TSR sets up a fake interupt by pushing the
stack, disabling single-stepping, disabling interupts, and pushing
the IP and CS onto the stack. It far-calls the "chained interupt" to
process the keypress. Once the "chained interupt" returns via IRET
the TSR checks to see if the key pressed is it's hotkey. (non-destructive)
If it's not the hot-key the TSR bails by IRET. If it is, it tosses
the hot-key out of the keyboard buffer. (so it wont be passed to any
other program)
Once the hot-key is detected, the TSR (this one) will copy a portion
of the screen, it's going to use into a buffer for later. It will then
write itself into that screen and pretty much operate like any other
program. Keep in mind, that during this time, any other program running
in this "task" is suspended. When you exit the TSR, it restores the save 
section of screen and sets up an interupt condition as before and IRETs.
There are several tricks to keep in mind. While the TSR in running it
controls the what interupts that are called with the exception of
processor and hardware interupts. This way you don't have to worry too
much about what "other programs" are doing because they are suspended
while the TSR is active. The other trick is that "this" example TSR is
chained into the keyboard interupt. It has to call this interupt like
any other program so the TSR needs to have a means to know when it's
running. Otherwise, you hit the hot-key, the TSR runs, you hit the
hot-key again, the TSR runs again. This a great way to crash a computer.
In a nutshell, you have a hardware interupt on a key-press. The tsr
chains the old vector first. Then checks for a hotkey. If hot-key
AND !!! if not "already running" run the TSR, if not IRET.
Once hot-key is detected, set a "TSR_active" byte to true. Toss the
hotkey and run. Once the TSR is done, setup a fake interupt and IRET
(as before).
Hope this helps...Glen....
--- ProBoard v2.15 [Reg]
---------------
* Origin: Bucolic Fair, Pasco WA 1-509-545-5031 (1:3407/25)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.