Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!princeton!allegra!ulysses!gamma!pyuxww!pyuxv!cim2 From: cim2@pyuxv.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Finding the address of functions in MSC, and the ^C interupt Message-ID: <283@pyuxv.UUCP> Date: Thu, 30-Apr-87 09:02:54 EDT Article-I.D.: pyuxv.283 Posted: Thu Apr 30 09:02:54 1987 Date-Received: Sat, 2-May-87 02:26:53 EDT References: <2042@hoptoad.uucp> Organization: CHC Lines: 40 [Long example of setting interrupts via set/getting interrupts using MSC] Several things come to mind: 1. There is no need to do this at all in MSC since they provide the signal() handler function - to call bye() when the user types CTRL-C just do: #include main() { int bye(); signal(SIGINT,bye); } 2. If you need to set interrupt vectors for some other reason (e.g. an RTL) the FP_SEG and FP_OFF macros give weird results when fed a function pointer - ( I was working on MSC 4.0 in Large memory model) It seems these only really work with variables (Is this a bug?) For my application, I coerced the function pointer to a long, and then split the segment/offset off: unsigned long lvar; int bye(); int seg,off; lvar=(unsigned long)bye; off= lvar&0xFF; seg= lvar>>16; I know this looks kludgy - but it works :) Rob Fair Bellcore/CHC