[comp.sys.mac.programmer] Cross Compilers for Mac ?

crs@nro.cs.athabascau.ca (Chris Gregors) (02/16/91)

        Our group is preparing doing some realtime embedded development
using a 680x0 target. Since we have a lot of Mac's around, we are
interested in 'C' cross compilers for the Mac. There seems to be a
shortage of cross compilers available for the Mac so I was wondering if
anyone has any info/opinions regarding cross development using 'C' and
the Mac. 
        We have already used the Aztec C rom compiler and would prefer
to use something else next time. I understand that the MPW C can be used
to do ROM development, however the problems involved with using MPW C
prevent it from being considered.

        If the response is great enough, and there is interest, I will
post a summary of the responses.

Thanks in advance eh!

Chris Gregors
Nova Corporation of Alberta

nv89-nun@alv.nada.kth.se (Nicklas Ungman) (02/18/91)

I'we also been thinking of doing some cross developing in the Mac. One way
to cross compile is to build a stand-alone code resource. This can be done
with both MPW C and THINK C, which are both good compilers. However, this
prevents you from using global variables, and also limits multi segmentation.

Does anyone know how to get around this problem?


/Nixxon

Lewis_P@cc.curtin.edu.au (Peter Lewis) (02/18/91)

In article <NV89-NUN.91Feb18003848@alv.nada.kth.se>, 
       nv89-nun@alv.nada.kth.se (Nicklas Ungman) writes:
> I'we also been thinking of doing some cross developing in the Mac. One way
> to cross compile is to build a stand-alone code resource. This can be done
> with both MPW C and THINK C, which are both good compilers. However, this
> prevents you from using global variables, and also limits multi segmentation.

   This is how we programmed a standalone 68000 for a micro-mouse competition
(albeit using THINK Pascal, but its basically the same).  Another problem
was that you had to be very careful about what you called, and how the
libraries worked (the silly thing crashed with and A-line trap, and it took 
us a while to find that my co-programmer (who shall remain nameless - Hi
John :-) had foolishly called Random).

> Does anyone know how to get around this problem?

   The way we solved this was to allocated a fixed space on the target
machine for globals - say $1000 bytes at $00400000, then do -
const
  globals=$00400000;
type
  gr=record
    any globals you want
  end;
  gp=^gr;

Then at the start of any procedure requiring global variables -
var g:gp;
begin
  g:=gp(globals);
  with g^ do begin
  ....
  end;
end;

   Its not particularly elegant, but it works ok.  If you dont want to
allocate a huge block of ram, you could just allocate a fixed pointer, and
use g^^.  Saddly, with C, you cant use nested procedures to mimic globals
(it wouldnt work very well with large projects anyway).
> 
> /Nixxon
HTH,
   Peter.
-- 
Disclaimer:Curtin & I have an agreement:Neither of us listen to either of us.
*-------+---------+---------+---------+---------+---------+---------+-------*
Internet: Lewis_P@cc.curtin.edu.au              I Peter Lewis
Bitnet: Lewis_P%cc.curtin.edu.au@cunyvm.bitnet  I NCRPDA, Curtin University
UUCP: uunet!munnari.oz!cc.curtin.edu.au!Lewis_P I GPO Box U1987
AppleLink: Guy Kawasaki for Apple President!    I Perth, WA, 6001, AUSTRALIA
Has anyone ever found someone who used a Mac and then Changed To a PC?

brian@umbc3.UMBC.EDU (Brian Cuthie) (02/19/91)

In article <Le9eX3w163w@ersys.uucp> ersys!crs@nro.cs.athabascau.ca (Chris Gregors) writes:
>
>        Our group is preparing doing some realtime embedded development
>using a 680x0 target. Since we have a lot of Mac's around, we are
>interested in 'C' cross compilers for the Mac. There seems to be a
>shortage of cross compilers available for the Mac so I was wondering if
>anyone has any info/opinions regarding cross development using 'C' and
>the Mac. 
...
>Chris Gregors
>Nova Corporation of Alberta


Why do you need a cross compiler.  If you are running on a Mac then you
already have a choice of decent 68K compilers.  Probably the best choice,
for lot's of reasons including that you can get the source to the linker,
is gnu c.

With a little bit of work and the right compiler/linker options, you should
be able to get code for just about any embeded 68K target.  Of course
source level debugging isn't going to be easy :-)

-brian

jordan@Apple.COM (Jordan Mattson) (02/23/91)

  You might want to check out the products from Diab Data, Inc.  They are at
           323 Vintage Park Drive
           Foster City, CA 94404
           Telephone:   415-571-1700
           Fax:         415-571-9068

  You might also want to check out the products of Introl:

          414-327-7171  - Rich Pennington


-- 


Jordan Mattson                         UUCP:      jordan@apple.apple.com
Apple Computer, Inc.                   CSNET:     jordan@apple.CSNET
Development Tools Product Management   AppleLink: Mattson1 
20400 Stevens Creek Blvd, MS 75-8X
Cupertino, CA 95014
408-974-4601
			"Joy is the serious business of heaven."
					C.S. Lewis

Chris.Gehlker@p12.f56.n114.z1.fidonet.org (Chris Gehlker) (02/25/91)

NU> I'we also been thinking of doing some cross developing in the 
NU> Mac. One way to cross compile is to build a stand-alone code 
NU> resource. This can be done with both MPW C and THINK C, which 
NU> are both good compilers. However, this prevents you from using 
NU> global variables, and also limits multi segmentation. 
NU> Does anyone know how to get around this problem? 

For MPW, see TN 256.  ThC let's one use A4 "globals."  Basically you just make
the right choices in the "set project type" dialog and use the ANSIA4 library.
 
--  
Uucp: ...{gatech,ames,rutgers}!ncar!asuvax!stjhmc!56.12!Chris.Gehlker
Internet: Chris.Gehlker@p12.f56.n114.z1.fidonet.org