microsoft c/ interrupt handler prob

herman lizac at maccs.dcss.mcmaster.ca
Wed Feb 20 11:55:47 AEST 1991


Is there any reliable way to use a function written in microsoft c version 6.0
as an interrupt handler?  I tried the following...

void serial_handler(void)

{
     asm {pusha}
     t_serial_handler();  /* this function is void t_serial_handler(void) */ 
     asm {
       popa
       pop si    /* this line and the next are from memory ,but i am */ 
       pop di  /* sure that they are in the correct order in my prog */ 
       leave 
       iret }
}
(and then put the segment and offset of the serial_handler routine at 
interrupt 0ch vector location).
it sort of works.  I get characters from my t_serial_handler routine, but
intermittently, and after about 8 to 16, the computer either 1) locks up
2) returns to DOS, after which any DOS command locks up the computer.
My t_serial_handler routine is very simple.  I think the problem is 
the way that i link the interrupt vector to it.

Is there an easy way to point to an interrupt handler written in c 6.0?
Have I erred in my definition of serial_handler?

If you have any insight about this problem, could you please email me
and let me know what i've done wrong?

thanks.

   
-- 
herman     love your nails         lizac at maccs.dcss.mcmaster.ca or something



More information about the Comp.lang.c mailing list