home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / atari / st / tech / 4444 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  1.4 KB

  1. Path: sparky!uunet!mcsun!uknet!gdt!aber!ssw
  2. From: ssw@aber.ac.uk (Simon the Loony)
  3. Newsgroups: comp.sys.atari.st.tech
  4. Subject: Using Setexec() [a bit of help needed]
  5. Keywords: Setexec(), BIOS, vectors, AAARRRGGGGHHHH!
  6. Message-ID: <1992Aug17.083005.6390@aber.ac.uk>
  7. Date: 17 Aug 92 08:30:05 GMT
  8. Organization: Department of Physics, University of Wales, Aberystwyth
  9. Lines: 43
  10.  
  11. Greetings,
  12.     I am currently writing a little program in C which requires that 
  13. certain errors, notably bus and address errors should be trapped. According to
  14. my copy of ``Internals'', Setexec() (BIOS function 5) will do just that and is
  15. defined thus :        long Setexec(exec_no, vector)
  16.             int    exec_no ;
  17.             long    vector ;
  18.  
  19. Where vector is the address of the routine to be executed when a certain error
  20. occurs, and exec_no is the execution number.
  21.  
  22. My program is (roughly) of the following form :
  23.  
  24. main(argc,argv)
  25. int    argc ;
  26. char    **argv;
  27. {
  28.     :
  29.     assorted code
  30.     :
  31. }
  32.  
  33. BusError()    /* This should be executed when a bus-error occurs    */
  34. {
  35.     printf("Bus Error!\n") ;    
  36. }
  37.  
  38. AddressError()    /* This should be executed when an address error occurs    */
  39. {
  40.     printf("Address Error!\n") ;    
  41. }
  42.  
  43. The question is, what do I pass to Setexec() for the addresses of each of these
  44. functions? According to my book on C, just taking the address of a function is
  45. not allowed.....
  46.  
  47. Help would be greatly appreciated.
  48.  
  49. Thanx in advance,
  50.  
  51. Simon.
  52.  
  53. -- .sig? I don't need no steenking .sig! :-)
  54.