Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!att!cbnewsc!n9bh From: n9bh@cbnewsc.ATT.COM (Bruce Corbett) Newsgroups: comp.sys.ibm.pc Subject: Re: Need help writting Turbo C TSR Message-ID: <13837@cbnewsc.ATT.COM> Date: 22 Feb 90 15:25:30 GMT Organization: AT&T Bell Laboratories Lines: 42 I'm *TRYING* to learn how to write a TSR in Turbo C. A short program follows: #include #include void interrupt (*oldfunc)(); void interrupt myfunc(); int flag = 0; main() { oldfunc = getvect(0x1C); setvect(0x1C, myfunc); keep(0, 10000 / 16); } void interrupt myfunc() { extern int flag; (oldfunc)(); if(flag == 0) { flag = 1; putchar('X'); flag = 0; } } As it stands this code prints a $, then a prompt, then about 5 $'s on the same line, then it hangs and I have to boot. If the putchar() is removed it will go resident and I see no ill effects. Please send help/suggestions to me at: att!nwgpb!n9bh or att!cbnewsc!n9bh Thanks in advance, Bruce Corbett