Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!jarthur!usc!cs.utexas.edu!sun-barr!newstop!sun!imagen!atari!portal!portal!cup.portal.com!ts From: ts@cup.portal.com (Tim W Smith) Newsgroups: comp.sys.mac.programmer Subject: Re: Surviving a Bus Error Message-ID: <28001@cup.portal.com> Date: 18 Mar 90 09:18:49 GMT References: <1990Mar13.192544.1617@asterix.drev.dnd.ca> Organization: The Portal System (TM) Lines: 34 Try something like this: long saveBusErrorVector; if ( setjmp( something ) ) { *(long *)8 = saveBusErrorVector; return GOT_A_BUS_ERROR; } saveBusErrorVector = *(long *)8; *(long *)8 = MyBusErrorHandler(); /* access your board */ *(long *)8 = saveBusErrorVector; return DID_NOT_GET_A_BUS_ERROR; The function MyBusErrorHandler would look something like this: SetupA5(); /* or whatever your development * system uses */ longjmp( something ); Check the Motorola manual to see what bus error does to the interrupt level. I would guess that it is treated like a level 7 interrupt, and thus sets the interupt level to 7. If so, you will have to do something about this. This will require assembly language. Tim Smith ps: when I say "this will require assembly language", I am assuming we are all gentle people who would not even think of casting a string pointer to a function pointer and calling it, or any other such things best not mentioned in polite company...