Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbatt!ihnp4!homxb!houxm!mtuxo!mtgzz!rosen From: rosen@mtgzz.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Finding the address of functions in MSC, and the ^C interupt Message-ID: <2642@mtgzz.UUCP> Date: Thu, 30-Apr-87 12:02:33 EDT Article-I.D.: mtgzz.2642 Posted: Thu Apr 30 12:02:33 1987 Date-Received: Fri, 1-May-87 02:47:19 EDT References: <2042@hoptoad.uucp> Organization: AT&T, Middletown NJ Lines: 32 Summary: use signal() function In article <2042@hoptoad.uucp>, pozar@hoptoad.uucp (Tim Pozar) writes: > > I was wondering how one finds the address of a function and would > apply it to setting a vector interupt with it. This is the code that > I came up with. It compiles with one error (see below). If anyone > has any insite on how this could be better done, I would like to > hear it. > Tim Pozar > [. . .] I didn't have a chance to look at your program in detail, but here are a few pointers. First of all instead of playing with interrupt vectors you should be using the C library call signal(). I don't remember the exeact parameters but it is in your manual and does axactly what you want--traps on ^C. But assuming you want to do it your way... You didn't say what your compiler error was, but it could be a pointer size mismach. Are you using the large modal? You probably sould be if you want to stuff a long function address into an interrup vector. It also might help to put an '&' infront of 'bye', as in: funcp = &bye; I once wrote a similar routine in MSC to cahnge interrupt vectors and restore on exit. If you need more info contact me and I'll look it up. -- Thomas Rosenfeld @ AT&T Information Systems Labs, Middletown, NJ (201) 957-5867 UUCP: {harpo,ihnp4,burl,akgua}!mtgzz!rosen Disclaimer: I don't claim anything.