<p>Am 15.02.2013 08:39 schrieb "Mike Salish" <<a href="mailto:mike@avantisys.com">mike@avantisys.com</a>>:<br>
><br>
> It was interesting to see renewed activity in the compiler for the 68K architecture. I've been using another old compiler, written in Pascal, for embedded development for many years and been wanting to give FPC a try. My existing compiler emits assembler for the 68K and CPU32 but lacks the features that FPC can provide.<br>
><br>
> I have been able to compile my existing compiler using FPC on a PC and find that the resulting code is about 10% bigger (and slower) than the same program compiled in Delphi. The good news is that when the FPC-compiled old Pascal compiler is used to compile a big (20KLOC) Pascal embedded program it produces exactly the same output. So as far as I am concerned this makes the FPC a very viable tool. All that is missing is the 68K code generator and RTL and... a few more bits.<br>
><br>
> The work that has been done to be able to compile 68000/020..040 code is admirable for completeness but of little practical value since it is difficult to find hardware. At the moment the 68K versions still in production are all for control applications in embedded systems. These chips use the CPU32 and more recently the MCF5xxxx Coldfire architecture. For MCF there are some sources of small and cheap demo boards (netgear, Arcturus I know of). IMO Coldfire is the only viable path for future development that can see any practical use. And I think MCF code should run on the CPU32 as well even though it will not use all the addressing modes of the CPU32.</p>
<p>As I'm the one who did most of the recent work on m68k I'm the one that definitely needs to answer you.</p>
<p>While I agree that no old style m68k CPUs are produced anymore there are still people that use them. We have e.g. a core developer that has an old Amiga. Also testing on different variations of the CPU might improve the generated code in the long run (at least this is my hope). <br>
Nevertheless I'm currently mostly working on Coldfire support. I'm mainly using QEMU's user space emulation on Linux which emulates a Coldfire V4e. But I also have a M54451evb with a MCF54451 and I also plan to purchase a M54455evb board.<br>
I'm trying though not to use ISA B and ISA C instructions in the compiler until I've split current "coldfire" type into the three different ISAs.</p>
<p>><br>
> I've downloaded the compiler sources and would ask that anyone who can provide the build strings and other tricks they have used to build a cross-compiler targeting the 68K/CF point me in the right direction. I've got the Build FAQ and Programmers Manual so I'm reading a lot.<br>
></p>
<p>I'm currently only working on m68k-linux, so I can't tell whether m68k-embedded would work, but you should be able to build it as follows inside the top level directory of the source (you need to use FPC 2.6.0 as starting compiler and preferably have it in PATH, otherwise look at the BuildFAQ):</p>
<p>make all CPU_TARGET=m68k OS_TARGET=embedded BINUTILSPREFIX=m68k-whatever- CROSS_OPT="-O- -Cpcoldfire"</p>
<p>"m68k-whatever-" is the prefix of your cross binutils (as and ld).</p>
<p>If that should fail you could try "make cycle" with the same options inside the compiler directory instead of "make all" in the top level directory.</p>
<p>When using the generated compiler (it will be called ppcross68k) you need to pass at least the following arguments:<br>
-Tembedded -XPm68k-whatever- -O- -Cpcoldfire -Fupath/to/compiled/rtl/units</p>
<p>The compiled units are normally located in $fpcsrc/rtl/units/m68k-embedded.</p>
<p>> I would like to build up a tool set that will produce assembler so that it can be analyzed for correctness before I try to run it on real hardware. I'm working in XP with Mingw, can work in OsX easily and in Linux with more effort (don't have a machine setup for Linux now). For me I have embedded emulator tools that work in XP so that would be my preferred path.</p>
<p>It might be necessary to add support for your specific hardware boards first. I'm not experienced enough with our embedded target yet... I could try to add support for my M54451evb as an example, but only starting in March, as I'm currently preparing for and writing exams.</p>
<p>Please also keep in mind that the m68k code generator is highly in development and while simple programs work already there are still enough things that fail and maybe code generator bugs that hide other bugs... So your mileage may vary... (and as you can see with the passed parameters optimizations are not yet working/tested either)<br>
<br>
Please keep me informed about any progress you make :)</p>
<p>Regards,<br>
Sven</p>