Coldfire Exception processing

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Coldfire Exception processing

3,103件の閲覧回数
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 返答(返信)

950件の閲覧回数
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 件の賞賛
返信

950件の閲覧回数
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 件の賞賛
返信