Path: utzoo!mnetor!tmsoft!torsqnt!geac!maccs!maccs.dcss.mcmaster.ca!lizac From: lizac@maccs.dcss.mcmaster.ca (herman) Newsgroups: comp.lang.c Subject: microsoft c/ interrupt handler prob Message-ID: <27C1C913.15970@maccs.dcss.mcmaster.ca> Date: 20 Feb 91 00:55:47 GMT Sender: lizac@maccs.dcss.mcmaster.ca (herman) Organization: McMaster University, Hamilton, Ontario, Canada Lines: 34 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@maccs.dcss.mcmaster.ca or something