Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!wuarchive!psuvax1!psuvm!auvm!univrel From: UNIVREL@auvm.auvm.edu Newsgroups: comp.lang.modula2 Subject: Re: Help with Mouse Function Please Message-ID: <90205.100101UNIVREL@auvm.auvm.edu> Date: 24 Jul 90 14:01:01 GMT References: <9007241146.AA05051@ctc.contel.com> Organization: The American University - University Computing Center Lines: 21 I have not worked with FST's compiler, but I have guess as to what is causing the trouble. You write your custom handler the same way that you write an interrupt service routine. You save all used registers on entry and restore them them on exit. However, and this is not well documented, the mouse driver calls your custom handler via a FAR CALL. Consequently, your handler CANNOT return via an IRET, but it must return via an FRET. Many M2 compilers can generate the appropriate code for an interrupt type function and they generate the appropriate standard exit code and return via an IRET; something you do not want a mouse handler to do. The solution, if your compiler supports it, is to use in-line machine code and insert it at the end of your routine. The compiler's exit code comes after your in-line code and therefore will have no effect. qquit Hope this helps. Sajjad Ahrabi Standard disclaimers apply.