[futurebasic] FB^3 FAQs [was: Convert 68K assem to PPC assem]

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 1999 : Group Archive : Group : All Groups

From: "jonathan" <jonnnathan@...>
Date: Fri, 17 Sep 1999 21:29:10 +0200
> I would like to convert few statements  from one of Ross Lambert's old
> filters. I'm passable with 68K assem but I don't know anything about PPC
> (and I'm not looking to get deep in PPC assembly).  Any clues, URLs,
> utilities, to help me with the conversion would be appreciated. I'll post
> the results to the list for anyone that has the FB PowerPack from Ross.

Hold the horses. I'm assuming that you want info for FB^3, even athough you
didn't label that in your subject... Because, otherwise your mail doesn't
make sense! Folks! Please use labels!

Here's the start of a PPC code FAQ:

Q: I have 68K assembler in my FBII app; Should I translate it to PPC

A: A general answer to this is NO! Here's why.

That code was in 68K assembler for speed. But don't forget that the code
that FB^3 generates is fast. In some cases several hundred times faster than
FBII! But FB^3 is more than damn fast, it's a whole new animal. And it's no
secret that Andy Gariepy, FB engineer 'par exellence', has stated that FB^3
is designed to be platform independant. (He has not, however, made any
promises...). This means then that you should keep as much of your code as
pure FB as possible. Why? Let's us suppose that one day we see a version of
Mac OS that works on Intel boxes (I can't for my life think why anyone
should want this, but as we are in the realms of suppostion, just suspend
belief and continue reading). So with a Mac OS on an Intel box, your PPC
code will break your app.
If your code is FB code however, you'll just have to install the
'MacOS-on-Intel back-end' for FB, probably change a few header files,
installing the ones that Andy'll sent you with the 'M-o-I b-e', and Robert's
your uncle... you're one of the first apps running on an MacIntel box!

Q: I have 68K assembler code in my FBII app; How can I translate this to FB?

A: Some has already been translated by Andy Gariepy himself for the benefit
of Beta testers who asked this same question. (I'll put up a web page of
snippets and their FB^3 equivalents - watch out for a URL here). But for
stuff that hasn't already been translated... Just post the snippets on the
FBII list, with the label [68K->FB^3], and then others can help you
translate this to FB^3. I can then collect the stuff for the FAQ pages, and
everyone will be coding much better and faster!

Q: Are there cases when I would need to code in PPC assembler?

A: It would be foolhardy to say 'No'! I can imagine at least 2 cases:
Ultra-fast pumping of graphics to screen - even though Apple has, under
pressure from game coders, slipped some damn fast routines that cut thru
QuickDraw bottlenecks. These sorts of things are hidden in the GameSprockets
libraries. Another case would be PhotoShop style number crunching, but in
this case you're not talking about number crunching in assembler, but more
about "a library to number crunch with G4s and AltiVec", and "a library to
number crunch with G3s", and "a library to number crunch with PPC 604s"...
because if speed is really your concern you can't optimise just for a
'standard' PPC, you'll have to optimise down to generation level on the
different processors.
All this goes to argue for avoiding PPC code in FB^3, but feel free to try
it out. And don't forget to share your experience with others.
FB^3 FAQsheets gnome