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

Re: [MiNT] MiNTLib for ColdFire : DONE !



Hi,

Ok, tricky. MVS and MVZ could be trapped and emulated, but the MAC instructions screw things up.. Didier solved the latter by using an unused TRAP instruction. Is this something which could be added to the kernel as well? It does make it slightly easier to write code for both systems, since I woudn't have to check which CPU I'm running on.

-- PeP

4 jun 2009 kl. 16.21 skrev Vincent Rivière:

No. The ColdFire lacks a lot of the 680x0 instructions and address modes, but it also adds a few new instructions. See at the bottom of this page:
http://www.microapl.co.uk/Porting/ColdFire/cf_68k_diffs.html

For example, there is no add.b and add.w on ColdFire. The data must be fetched into a register, then add.l can be used. The new mvs and mvz instructions can be used to fetch a byte or a word, then fill the remaining part of the target register to be suitable for add.l.

Some examples here (in French):
http://coldfire.zewan.com/68k_cf.htm

GCC uses a lot these new instructions, as well as 68020 instructions compatible with ColdFire, so without a CPU check ColdFire binaries crashes on 68000 and 68020.

--
Vincent Rivière