Coldfire Exception processing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Coldfire Exception processing

2,664 Views
stzari
Contributor III
Hello,

I have a question on the exception processing of the Coldfire MCF5235 CPU.

The Coldfire Programmer's Reference Manual (Ch. 11, p. 11-1) states that "Coldfire v2 and v3 use an instruction restart exception model".
Does this mean that when I generate an access error with an operand fetch, after returning from the exception handler with RTE, the CPU
will retry the same instruction ?

TIA
Labels (1)
0 Kudos
Reply
2 Replies

511 Views
mvincent
Contributor I
That's right. If you are 'testing' the accessability of a memory location, you must either skip past the instruction that caused the access error (ie. increment the PC in the exception stack frame) or write the access test in assembler using indirect addressing with a specific Ax register which you modify to a safe location in the exception processing. For instance:

C declaration:
> int readLongTest(void*); /* return 0 on success */

Assembler:
> _readLongTest:
> clr.l d0
> move.l 4(sp),a0
> move.l (a0),d1
> rts
>
> _accessErrorHandler: /* install on vector 2 */
> not.l d0
> clr.l a0
> rte

Hope this helps.
0 Kudos
Reply

511 Views
stzari
Contributor III
Thanks a lot.

This confirms my suspicions, why my code (that works fine on different 683xx) crashes my Coldfire board.

St.
0 Kudos
Reply