[net.micro.pc] Interrupts in Turbo 3.0

mercury@ut-ngp.UTEXAS (Larry E. Baker) (08/08/85)

[x]

About 4 months ago, someone posted a small chunk of TURBO-3.0 code
demonstrating how to use TURBO Pascal routines as interrupt handlers.
I have been unable to contact the author (steka@hou2g) about his
posting.

As I remember, there were quite a few undocumented things that had to
be done (like resetting the DS register inside the routine, as it
might be interrupting a system routine and the DS would be different
from what you expect).

Now my question:  Is there anyone out there who has had any experience
with interrupt handlers in TURBO?  The errors he cited  were
relatively serious, and should have been somewhat obvious to the
designers at Borland.  One would think that the READ.ME file would
have at least mentioned this UNLESS they had figured out some way to
make the compiler work the way the manual says it should work.

Many thanks in advance,

						Larry

halff@utah-cs.UUCP (Henry M. Halff) (08/08/85)

The latest issue of TUG Lines, the Turbo User's Group newsletter has an
article on interrupts in Turbo Pascal.  Their address is 

Turbo User Group
P. O. Box 1510
Poulsbo, WA 98370

HH

mikey@trsvax (08/15/85)

> As I remember, there were quite a few undocumented things that had to
> be done (like resetting the DS register inside the routine, as it
> might be interrupting a system routine and the DS would be different
> from what you expect).

What do you mean "undocumented"????  The first rule of an interupt is to
assume nothing, the second is to save everything that you might touch.
The only "undocumented" trick I can think of is the fact that the interupts
are 'edge' triggered and you must do your EOI processing before the next
edge occurs or you might miss it.  If you miss the edge and the interupt
continues to hold the interupt line, you might loose interupts from
that point on.  Even this is not usually a problem unless you have
some hardware that requires extensive processing and the interupts happen
very often, or you have multiple interupts that share a common hardware
interupt line.  The Tandy 2000 serial expansion board has a possible
24 different interupts that can occur on one line.  That code had to 
be TIGHT!  Of course, that's with two boards in one machine for 8 serial
channels, but it can be done.

mikey at trsvax