Masking / Handling Processor Exceptions

Discussion to talk about software related topics only.
Post Reply
bnsarvis
Posts: 7
Joined: Fri Jan 25, 2013 6:36 am

Masking / Handling Processor Exceptions

Post by bnsarvis »

Hello,

Is there a way to mask a processor exception - such as the "spurious interrupt" exception? If not, is there a way to write an exception handling routine that would return the processor to its previous operating state? It would be great if there was an equivalent EXCEPTION() macro to the INTERRUPT() macro.

Thanks.

Brian
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: Masking / Handling Processor Exceptions

Post by pbreed »

Create an INTERRUPT function ...

Then put that function in the exception vector you want to handle...

The minor details of this are processor specific... what processor are you asking about?


The Spurious interrupt is usually exception vector 24...

So

INTERRUPT(MySpurHandler,0x2700)
{
//Count hte spurs here or something...
}


vector_base.table[24]=(long)MySpurHandler; //Spurious exception...

some other interesting entries you might want to grab...

5 -- devide by zero
2-- access error
3- address error....

etc...
bnsarvis
Posts: 7
Joined: Fri Jan 25, 2013 6:36 am

Re: Masking / Handling Processor Exceptions

Post by bnsarvis »

Beautiful! I love that the INTERRUPT macro can be reused. The processor is the Coldfire on the MOD5270B, so yes, the exception vector is 24. I'll give it a shot. Thanks!

Brian
Post Reply