Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!amdcad!sun!pitstop!texsun!texsun.central-relay.sun.com!convex!convexe!authorplaceholder From: loafman@convexe.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: MSC 4.0 interrupt (^C) handler help Message-ID: <63200025@convexe> Date: 29 Jan 88 15:43:00 GMT References: <682@silver.bacs.indiana.edu> Lines: 41 Nf-ID: #R:silver.bacs.indiana.edu:-68200:convexe:63200025:000:2085 Nf-From: convexe.UUCP!loafman Jan 29 09:43:00 1988 /* Written 7:25 pm Jan 27, 1988 by creps@silver.Sun.COM in convexe:comp.sys.ibm.pc */ /* ---------- "MSC 4.0 interrupt (^C) handler help" ---------- */ I'm trying to get an interrupt handler to work in MSC 4.0 that will handle ^C's at any time. The manual isn't a lot of help, giving only one example with the signal routine. I wrote a test program which is basically for(i=1;i<100000;i++) if (i % 10000 == 0) fprintf("%d",i); and it seems to work, except that it waits until it's ready to print the next number before calling the interrupt routine. However, it does seem as if it is storing the interrupt until output is done, and not just waiting until the output before it even recognizes the interrupt. ...remainder deleted... /* End of text from convexe:comp.sys.ibm.pc */ Steve, Your assessment is correct, MSDOS is waiting until the I/O is done (or until the first i/o system call is done) before recognizing the interrupt. Until then, it is just queued (logically) into the first keyboard buffer position. If you want more frequent looks at the state of Ctrl-C, then do a 'break on' in either autoexec.bat, or do the appropriate system call. This will cause MSDOS to look at the state of Ctrl-C on every system call, and not just those specific to i/o. Basically Ctrl-C handling is polled, not interrupt driven. There is a 'user settable' interrupt, 0x1B I think, that gets called as soon as the keyboard handler sees the Ctrl-C. If you write your own interrupt routine, you could do something intelligent then, such as setting a global flag or such. Keep it simple though. Keyboard interrupt routines are hard to debug without a hardware based debugger. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Kenneth W. Loafman @ CONVEX Computer Corp, Dallas, Texas | All opinions Voice: work: (214) 952-0829 home: (214) 964-1250 | are my own, USPSnail: 1705 Coit Rd #2101, Plano, Tx 75075 | of course. UUCP: ihnp4!convex!loafman | ...KWL ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~