home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!gdt!aber!ssw
- From: ssw@aber.ac.uk (Simon the Loony)
- Newsgroups: comp.sys.atari.st.tech
- Subject: Using Setexec() [a bit of help needed]
- Keywords: Setexec(), BIOS, vectors, AAARRRGGGGHHHH!
- Message-ID: <1992Aug17.083005.6390@aber.ac.uk>
- Date: 17 Aug 92 08:30:05 GMT
- Organization: Department of Physics, University of Wales, Aberystwyth
- Lines: 43
-
- Greetings,
- I am currently writing a little program in C which requires that
- certain errors, notably bus and address errors should be trapped. According to
- my copy of ``Internals'', Setexec() (BIOS function 5) will do just that and is
- defined thus : long Setexec(exec_no, vector)
- int exec_no ;
- long vector ;
-
- Where vector is the address of the routine to be executed when a certain error
- occurs, and exec_no is the execution number.
-
- My program is (roughly) of the following form :
-
- main(argc,argv)
- int argc ;
- char **argv;
- {
- :
- assorted code
- :
- }
-
- BusError() /* This should be executed when a bus-error occurs */
- {
- printf("Bus Error!\n") ;
- }
-
- AddressError() /* This should be executed when an address error occurs */
- {
- printf("Address Error!\n") ;
- }
-
- The question is, what do I pass to Setexec() for the addresses of each of these
- functions? According to my book on C, just taking the address of a function is
- not allowed.....
-
- Help would be greatly appreciated.
-
- Thanx in advance,
-
- Simon.
-
- -- .sig? I don't need no steenking .sig! :-)
-