Here is an overview of assembly language from a PowerPC perspective that contrasts examples for three architectures: ia32, ppc, and ppc64. This article assumes a basic understanding of computer design and of operating systems (system calls, exceptions, process stacks). It contains information that will be useful to PowerPC programmers unfamiliar with assembly as well as programmers who already know IA32 assembly and want to broaden their knowledge.
Yes, it’s a good introduction.
If you are looking for a more technical article, my recommended books are “PowerPC Compiler Writer’s Guide” http://www-3.ibm.com/chips/techlib/techlib.nsf/products/IBM_High_C_… and Motorola is Programming environment Manual” http://e-www.motorola.com/webapp/sps/site/homepage.jsp?nodeId=03M94…
By the way, I’m writing a Spanish language tutorial “Tutorial de ensamblador del PowerPC para Mac OS X” if you are interested in it, please visit http://www.macprogramadores.org/tutoriales/propios/propios.shtml
It’s well worded, easy to follow and got a bunch of nice links at the end. Definately a must read for any IA32 assembly coder as well as any PowerPC developer desiring to understand a bit more how things are done at a lower-level!
Just when I was looking for some articles about operating system development, OSNews runs an article series about it. And then, just when I was looking around for information about PowerPC assembly, OSNews puts up a link to a PowerPC assembly primer.
Hmm…I sense a pattern…
*searches the ‘net for info about making tons of money while doing absolutely nothing*
*waits for OSNews to post an article about it*
with apple computers gaining ground amongst geeks (theyre actively marketing to us these days) i wonder if the alternative OS crowd will go that way. certainly ppc asm is much nicer than x86 and the memory management makes more sense.
i know my hobby OS project will use my shiny iBook, not my x86.
Who complained about this article? nullpointer seems to be praising OSNews for resonating with his exact interests at different points in time.
Concerning complaints in general: that’s what happens when you allow open commentary, you get reponses you like and ones you don’t. I’m all for it, but if you don’t like it either disable commentary or make users register. I’d leave it how it is and if you don’t like some comments just ignore them.
I’m really tired of this opensource/non-profit/enthusiast “you not allow to criticize because I do this for free.” You’re exposing your work to a community and therefore we all have a right to an opinion. Of course, you don’t have to do a single thing we suggest or demand, that’s the differentiating factor, not whether or not we make negative comments.
>Who complained about this article?
Read here to see who did:
http://www.osnews.com/moderation.php?news_id=1558
It was not nullpointer, it was holofix.
And please do not post off topic here.
I agree with Eugenia. I often watch the evening “news” on television and see interesting stories that may not be classified as “news”.No problem here. I like seeing articles posted about OS progress, guides and tutorials, industry news, and the like. Keep up the good work.
>Who complained about this article?
>Read here to see who did:
>http://www.osnews.com/moderation.php?news_id=1558
>It was not nullpointer, it was holofix.
I don’t really think that was a complaint, more a doubt and a suggestion. Anyway my understanding is that your post on the front page is more a reaction to a large number of posts over a span of time, rather than one in particular.
In anycase I reiterate what everything in my earlier comments.
>And please do not post off topic here.
Ok. Where then? Forums?
> my understanding is that your post on the front page is more a reaction to a large number of posts over a span of time, rather than one in particular.
This is correct.
>>And please do not post off topic here.
>Ok. Where then? Forums?
Nowhere. OSNews has specific topics each time. You either confront with these topics and comment about them, or you don’t comment at all. You can comment on our “OS Forums”, for topics specifics to the operating system you want to comment on.
BTW, this whole thread has absolutely nothing to do with PPC assembly, so any other comment talking about this issue, will be modded down.
First IBM lets a story leak about their new Power4 derived desktop processor, now they post a PPC assembler guide. You have to wonder if they’re planning to revitalize the architecture, and take advantage of the current confusion of the direction of 64 bit processors in the Intel world to make some inroads (that is, will the 64 bit future be Intel’s ia64, or AMD’s Hammer? Or both?). I sure hope this is a sign the PPC architecture is coming back to life in the consumer world. I had high hopes for it when it first came out, and then watched with dismay as Apple/IBM/Motorola fumbled the ball, and left it to languish.
I have to wonder what IBM has up their sleeve – while Apple and the new Amiga will obviously provide a decent market for PPC, one suspects there’s more to IBM’s renewed interest in the desktop than just that.
Anyone else care to speculate?
> This is indeed good stuff, but I’m not sure I understand why it is here. It isn’t exactly news. =(
I was meant to write a message like this for quite some time and leave it at the top, so more readers can see it. People, STOP complaining when we put up development articles (like the PPC one we did today) or when we put .NET or Microsoft articles or sci-fi news. OSNews is about ALL platforms, IT IS all about development (I am a developer myself, so by not putting such articles up it would not have been fun or interesting), about operating systems and NOT ONLY operating systems. We write about everything that would interest a geek reader. By definition, people who like alternative OSes, a major part of them are developers (but not all). Now, a major part of these developers (but not all) do like sci-fi. It is all like a chain, and we try to make everyone happy with our content. If there is an icon for something (for example, the (http://www.osnews.com/topic.php?icon=45 )movie icon or a (http://www.osnews.com/topic.php?icon=30 )humor icon) it means that this icon is there because we want to put such news/articles from time to time. It is not there by chance, neither we publish non-OS news articles by mistake. Each and every article is there, because we believe it would be interesting news for a lot of our readers (including ourselves). OSNews is a hobby for us (at least for me it is), so it has to be fun. If it ain’t no fun, we shut off OSNews, turn off our computers, and we all go out more. The fact that OSNews is so extremely popular (now we average more than 55,000 pages per day!) is a… (welcomed) byproduct of our work. Nothing more. We do not seek to be CNN or C|Net News.com, so if you have a problem with our articles or with our grammar/spelling, go elsewhere. Or simply bypass the articles that do not interest you.
I have no idea why they want to. I could speculate about Jobs having visited the big blue, or that IBM wants to use these “desktop” CPUs in upcomming non desktop systems (for example gaming consoles, set top boxes, etc).
Or they might want to push a linux desktop system. Not that I see the sense in that myself. It is a bit of a mystery.
But as far as an assembler tutorial goes, that is for a very very selective class of people (plus those who are just interested for the hell of it). A good compiler is what is needed, and that effectivly takes care of the slightly icky x86 registers and such. Optimizations in the CPU has also eaten up a lot of the dumb overhead, and takes away the disadvantage of a dumb architecture. 68k/PPC is nicer and neater for the assembler coder and for us humans though. But again, the compilers are way more important, especially if you want to fill any form of SIMD systems so they run at full potential.
I have done extensive PPC coding on Apple computers and now on the GameCube and it is the most wonderful chip to code for by a long shot.
PPC coding in essence is working with the cache. Knowing how the cache works and how best to structure your data and code to work well with it will make you PPC coding/tuning machine. Instruction scheduling is important too, but it is usually a pretty straightforwad process compared with writing code to stay within the cache.
The other big issue with coding for the PPC is the large number of registers. A typical optimized PPC routine will have a large number of unrelated loads at the top followed by computation on registers mixed with stores. Very often I would code up a C version of the routine I was working on and let the compiler make a first pass at register allocation and work from the dissasembly. Always a good idea to have a drop in working C replacement to verify against the hand coded assembly version anyway.
I’ve luckily had minimal need to write x86 assembly. What a nightmare. Just plain ugly.
The need for hand coded PPC routines is much smaller now days since it is a mature architecture and fantastic compilers like Metrowerks are available and have had time to fine tune their code generation.
And finally, “with apple computers gaining ground amongst geeks”
Gaining ground? Uh, yeah, whatever…I think you meant to say “gaining envy from the x86 Linux crowd” To use a lame Slashdot expression OS X + Power 4 derivative – drool…
Gaining ground? Uh, yeah, whatever…I think you meant to say “gaining envy from the x86 Linux crowd” To use a lame Slashdot expression OS X + Power 4 derivative – drool…
its gaining envy amongst those who havent already bought one. about one in five people at my local LUG have bought macs of some description in the past 6 months…
the other 4 just really really want one…
about one in five people at my local LUG have bought macs of some description in the past 6 months…
the other 4 just really really want one…
That could have an interesting effect, assuming more Linux Mac buyers translates into more Linux PPC development. While Linux PPC has come a long way, it still has a way to go to reach parity with x86 Linux.
But here’s where it gets interesting. Unlike OS X, Linux PPC isn’t tied uniquely to Apple hardware. If PPC Linux becomes popular in it’s own right, that could open the door for 3rd party PPC system vendors. Which would be a good thing, IMHO. x86 could use some competition as a commodity hardware platform.