Prev: Numonyx/ST M45PE80
Next: STUDIOT::Re: low-power-cons, low-cost, uP+DSP combo for H.264 videoencoding & control/monitor application
From: Jim on 25 Jun 2010 16:59 Hi, 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
From: David Brown on 25 Jun 2010 17:46 Jim wrote: > Hi, > > 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? > 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 www.codesourcery.com 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.
From: Chris Burrows on 25 Jun 2010 20:51 "Jim" <adirondackmtn(a)yahoo.com> wrote in message news:84ff00c2-3f07-4653-a538-f8b4da42841d(a)b35g2000yqi.googlegroups.com... > Hi, > > 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? > 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: http://www.cfbsoftware.com/modula2 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 http://www.astrobe.com
From: Chris Burrows on 26 Jun 2010 08:50 "Jim" <adirondackmtn(a)yahoo.com> wrote in message news:84ff00c2-3f07-4653-a538-f8b4da42841d(a)b35g2000yqi.googlegroups.com... > > 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. 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: http://www.bitsavers.org/pdf/manx/ There's also a version rebundled for Windows XP which you can download from: http://www.aztecmuseum.ca/compilers.htm Regards, Chris Burrows CFB Software Astrobe: ARM Oberon-07 Development System http://www.astrobe.com
From: 42Bastian Schick on 28 Jun 2010 02:52
On Fri, 25 Jun 2010 13:59:05 -0700 (PDT), Jim <adirondackmtn(a)yahoo.com> wrote: >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? 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(a)yahoo.com, it's a spam-only account :-) Use <same-name>@monlynx.de instead ! |