Page 1 of 1

Masking / Handling Processor Exceptions

Posted: Mon Aug 12, 2013 7:32 pm
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

Re: Masking / Handling Processor Exceptions

Posted: Tue Aug 13, 2013 10:52 am
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...

Re: Masking / Handling Processor Exceptions

Posted: Tue Aug 13, 2013 1:07 pm
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