Coldfire Exception processing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Coldfire Exception processing

3,096 次查看
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
标签 (1)
0 项奖励
回复
2 回复数

943 次查看
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 项奖励
回复

943 次查看
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 项奖励
回复