🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by tcamp Thu, 04 Jun 1987 16:09
Intercepting a PC interrupt
#51
Author: tcamp
Date: Thu, 04 Jun 1987 16:09
31 lines
1800 bytes
I need some help writing a routine to intercept a PC interrupt.

The interrupt I want to intercept is 1Ch--the user-available
clock tick.  I want to do some things in the background.  I want
to call a c function from this interrupt.  I'm using Mark 
Williams C on IBM-compatible machine.

So far I have written an assembly-language routine that saves
the registers, restores the DS register to that of my program
area (where the c routines are), calls the C function, then
restores the registers before issuing an IRET instruction.  

When I call a null, or simple, c function, this seems to work 
o.k.  But when a call a slightly more complex function which 
in turn calls a function which passes parameters on the stack, the stack
stack seems to get clobbered, and the thing fails.  

I'm not sure if this is because (a) I need to set up a new stack
every time the interrupt routine is issued (any suggestions?) or
(b) the intercept routine is now so large that it is being interrupted 
by itself.  Maybe I should CLI and disable interrupts, but when I try
this in the routine, nothing seems to work.  

This probably sounds like a hopeless mess.  Any suggestions as to 
diagnostics or possible remedies?

-Ted A. Campbell
 Duke University
 Durham, NC  
 email:  tcamp@ecsvax
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads