I have this home project and am currently set up with a MS Windows gcc cross compiler to 68000. I did a quick look at the assembler and saw that when I passed a single variable to a function, it was pushed onto the stack. I think that overhead could cause problems. I'll talk to the gcc guys to see if there's some setting to get around that. But, to plan ahead, I thought I'd casually look around for a used 68000 compiler & linker--I don't want to spend thousands on a brand new one. I know of several used test equipment sites, but so far a google search has only found one site that had a compiler (I think it was HP BASIC). Does anyone know of any used tech sw sites?
Thanks,
Jim
Didn't find your answer? Ask the community — no account required.
D
David Brown
If you are looking for a good compiler for the m68k, and don't want to spend very large sums of money, then gcc is almost certainly your best choice (personally, I think gcc is the best choice for the 68k target even if you /do/ have lots of money to spend, but not everyone agrees on that).
If you think gcc is producing poor code, there are three likely explanations. One is that you might have a very old version of the compiler - anything older than gcc 4.3 is out of date. If you have just searched around the web for gcc for the 68000 or the m68k, it's not unlikely that you have found an old version - perhaps gcc 2.x, since newer versions are almost invariably referred to as targeting the Coldfire. But since Coldfire is basically a newer variant of the m68k, the same compiler works fine for the 68000.
The second reason for producing poor code is if you've got the wrong compiler flags. If you don't specify any optimisation flags (-Os and
-O2 are typical choices), you get target code that is a very simple direct translation of the source code, and it is neither small nor fast.
The third reason is that you are missing an understanding of the architecture and its ABI conventions. On the m68k, the standard calling convention IIRC is to use D0 and D1 for the first two arguments, then to push the other arguments on the stack. However, there may be other calling conventions that push /all/ the arguments on the stack. You will need to check if you are using the correct flags for the calling convention you need, or alternatively check that the gcc you have was configured for the correct platform (there may be differences if it was configured for a plain elf target, or a unix target).
If the compiler is generating code for a function that has external linkage, the code must follow the ABI for the platform - and that means arguments on the stack. The way to improve on this is to make good use of modularised and structured code, along with "static" for any function that is not exported from a module. That way most functions are under full control of the compiler, and it can be more flexible about argument passing.
I would recommend that you look at
formatting link
for a current version of gcc for the Coldfire (and thus for the 68000). You can download an entirely free version, or pay for a version with Eclipse integration and a support contract.
C
Chris Burrows
Thinking outside the square - the 68000 work I have done most recently did not use a cross-compiler. I used 68000 development hardware i.e. a Mac Quadra and a Sage IV both of which I got on eBay. In my case I used the MacMeth Modula-2 compiler on the Mac. The source is available on my website along with the source of a 68000 assembler written in Modula2:
formatting link
I wouldn't have thought it was too difficult to get a C compiler for the Mac.
Regards, Chris Burrows CFB Software
Astrobe: ARM Oberon-07 Development System
formatting link
C
Chris Burrows
It might be ancient (1988) but it had a very good reputation in its day - Manx Aztec C68K. The MS-DOS version and a PDF manual on BitSavers:
formatting link
There's also a version rebundled for Windows XP which you can download from:
formatting link
Regards, Chris Burrows CFB Software Astrobe: ARM Oberon-07 Development System
formatting link
4
42Bastian Schick
I don't have a link. But IAR eg. offers eval versions. Also Codewarrior can be get for free with a size limitation. But I am not sure if both do plain old 68000 or only ColdFire.
42Bastian
Do not email to bastian42@yahoo.com, it's a spam-only account :-)
Use @monlynx.de instead !
J
Jim
to
e
t
g
Thanks Dave. Like I said, I planned on looking into the compile flags to see if I get reduce the tendency to use the stack. That's a good idea about external linkage though--I didn't think about that. Some functions are indeed external, but many are not. It's been so long since I looked at the assembler (been far too busy), I'll have to check again to see if they were local functions or not.
Thanks again,
Jim
J
Jim
to
e
d
te
Thanks Chris, but I really want a C compiler and I need control over things like startup code, code placement in ROM/RAM, etc. which some/ most? desktop compilers won't give me.
Jim
J
Jim
om:
Chris,
Yeah, I have that compiler, but I'm not confident I'll have control over things like startup code, code placement in ROM/RAM, etc. I will look at when I have some time.
Thanks again,
Jim
J
Jim
42Bastian,
Thanks, but trial-ware isn't what I'm after (probably going to be too limited). Now if somebody had an IAR with dongle for sale... :)
Jim
B
Boudewijn Dijkstra
Currently it only targets ColdFire V1 and V2 cores.
I hope not. The license agreement of most commercial compilers prohibits transfer of the software and the license.
Gemaakt met Opera's revolutionaire e-mailprogramma:
http://www.opera.com/mail/
(remove the obvious prefix to reply by mail)
C
Chris H
In message , Boudewijn Dijkstra writes
Most is not all... and in fact many commercial compiler companies do permit the transfer of compilers.
IAR say it is not a problem.
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.