[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] MiNT on Firebee



Thanks, that helped :) It still choked on a "oriw 0x0700,sr" in
mint/arch/asm_spl.h, I worked around that in a way I really don't know
works...

move sr,d0
oril 0x0700,d0
move d0,sr

This was exactly the thing to do :-)
Fixing assembler sources for ColdFire is usually not more complicated.

or even if it's OK to clobber d0.

This is the question.
You have to look after that code to see if the previous contents of d0 are used afterwards. And if it safe to clobber d0.

It is almost never safe to clobber d0. If it is clobbered bu an inlined asm routine, you have to tell gas which register get clobbered, so that gcc allocates registers properly during code generation.

An alternative approach is to save and restore the clobbered register. So maybe a sort of this:

 move.l d0,-(sp)
 move sr,d0
 oril 0x0700,d0
 move d0,sr
 move.l (sp)+,d0

would do?

Pozdrawiam
KMK