On May 9, 1:41 am, Gregory Weston <u...@[EMAIL PROTECTED]
> wrote:
> In article
> <Pine.LNX.4.44.0805071236490.13992-100...@[EMAIL PROTECTED]
>,
> Beta Zero <beta_z...@[EMAIL PROTECTED]
> wrote:
<SNIP>
> > hard to come by? I want to ****t some Atari ST code over to the Mac.
> > I have about a meg of 68000 source code - that's not much but it
> > represents several years of handtinkering, and fine-tuning. It's
> > independent of GEM binding (I always had trouble with GEM, so I
> > manhandled the thing into existence, occasionally delving into
> > supervisor mode when necessary.).
>
> > I was wondering if it would be easier hand-tinkering this into shape
> > for execution on a Mac.
>
> The assembly? No. Not least because at the moment the active base of Mac
> users includes two radically different architectures, neither of which
> has an assembly language that looks more than superficially like 68k.
> The odds you'll beat modern compilers by hand-tinkering are miniscule.
> The odds you'll beat them significantly enough to eclipse the time taken
> hand-tinkering are essentially nil.
That's one problem, but really, learning another architecture to code
is not that unsurmountable. What's more difficult imho is learning how
to call the API. If your orignal code does nothing but console type i/
o you could link to c standard libs or perhaps do naughty
unrecommended things like call the kernel with syscalls, but given
you're saying you coded for an Atari I'm guessing there's graphics
involved. This will be more involved and imho you're going to have to
learn to deal nicely with the OS nicely and that will mean learning
the necessary APIs to call what you need.
Then you're better off learning to do it in objective-C, which
probably means just a little more effort than learning a new CPU
architecture. I think you'll get to know the API's much quicker this
way. I know it sounds like more work but that's probably what you'll
need to do, and ultimately my guess is going the objective-C way is
probably going to result in you ****ting it faster... Part of the
problem is finding do***entation on how to do things the right way in
assembly.
Don't be put off though, if you still want to learn IA-32 assembly,
and have the time to do it, by all means do it. It may not be very
productive but you got to admit it, if you've time to burn it's a lot
of fun. One thing I think you'll notice and will have to get used to
is the smaller register set, and somewhat slightly less orthogonality.
If you actually you have a PowerPC in your mac mini, then you may see
a few more similarities to a 68k but there are drastic differences as
well. Pity that chip is going to be resigned to embeddeds and game
consoles :( Would have loved to see it developed more for the
mainstream pc. :( :( :( :( Now we're stuck with intel/amd pretty
much...
One great way is to gcc with the -S option on to see what the compiler
spits out. The other way is to trawl on line. The one thing you
probably won't find a lot on is how to write and link asm code on OS X
to c libs or cocoa but I have to admit, I've not been actively looking
for stuff like this for a while and I've a feeling the best way is
just to see what the compiler spits out.
If you do find good links do let me know I'm interested.
Robert Spykerman


|