Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ASM & Co. for PPC
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Tue May 11, 2004 8:20 pm    Post subject: ASM & Co. for PPC Reply with quote

Hi there,

can anybody give me some link where I can find a good overview over the PPC instructions set and perhaps deeper informations about the altivec extensions? Of course I could download all the specs at IBM or Motorola, but a "fan"-site showing me the coolness or the cleverness would be much better to have a first look. To learn it one will of course use the manufacturers handbooks.

I never programmed PPC and would like to see if - and if yes how - it is nicer than x86 & Co. and perhaps worth of beeing learned by me ;-) .

Thank you
Marcel
Back to top
View user's profile Send private message
toojays
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 150
Location: Adelaide, Australia

PostPosted: Wed May 12, 2004 1:28 pm    Post subject: Reply with quote

I haven't explored this topic much, but am kind of interested in it since I have a G3 and will be getting a G4 soon.

I can't recommend any sites, but one thing which is always a good idea when starting with a new assembly language is to look at the output of gcc with no optimisation.

I usually use a program like the following:

Code:
int main()
{
  int x;
  int y;
  int z;

  x = 1;
  y = 2;

  z = x + y;
  printf("z is %d", z);
  return 0;
}


Then look at the output from "gcc -O0 -S test.c -o test.s". If you already know an assembly language, you should be able to recognise things like setting up the stack frame, loading x and y from immediate operands, and calling a function. Of course the ABI and architecture manuals need to be consulted to understand the finer details.

If you don't already know an assembly language, or about conventions for setting up the stack, calling functions etc, PowerPC looks like a difficult one to start with, at least compared with SPARC or MIPS.

Anyway, sorry that I couldn't answer your actual question, but I would be interested to see what sites you do find, or to continue this thread with further discussions of PPC assembly and Altivec.
Back to top
View user's profile Send private message
xavier10
Guru
Guru


Joined: 19 Jan 2004
Posts: 449
Location: Paris, France

PostPosted: Wed May 12, 2004 7:21 pm    Post subject: output of GCC ; some info on the web Reply with quote

Actually, I think this is a very good recommendation: you will see the most common instructions and the way the registers are used.

You can even get this reading more profitable by turning on the debugging mode. Then, gcc will anotate the code with information about the variable mapping, the encoding of data structure and so on (this gives you hint about how the language is used to encode what you are thinking about).

I am actually working with the power pc assembler and it was the first assembly language I had to learn. I was also a bit scared with starting with the motorola documentation, even if I had a good programming experience but it the documentation is quite good (if you choose the right version). Precise, clear and you can usually get quickly the info you want.

Here is a nice document I found when I started:
http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/index.html

This site contains information about the assembler of MacOSX, but it also goes through a rational and fast introduction to the main features (registers, addressing modes, mnemonics).
A nice start before you learn the specification!

You can also get a pdf:
http://developer.apple.com/documentation/DeveloperTools/Reference/Assembler/Assembler.pdf

Hope it helps

Regards,

Xavier
Back to top
View user's profile Send private message
mrdavedog
n00b
n00b


Joined: 11 Feb 2004
Posts: 34

PostPosted: Fri May 14, 2004 4:24 am    Post subject: Reply with quote

http://www.lightsoft.co.uk/Fantasm/Beginners/begin1.html

Is pretty useful although it's Mac centric.
Back to top
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Fri May 14, 2004 4:45 pm    Post subject: Reply with quote

Thank you all.

I don't have any PPC for now. So I can only read docs and dream of a dual G5 laptop ;-) But I will have a look at the given links here. Especially the dev.apple site looks promising :-) (addressing explained etc.)
Back to top
View user's profile Send private message
tokugawa
n00b
n00b


Joined: 11 Oct 2002
Posts: 40
Location: Olesnica, Poland

PostPosted: Thu Mar 31, 2005 6:55 am    Post subject: I'm starting to love PPC Reply with quote

Is there a kick-ass assembler for PPC ? or i'm tied to gnu/as ?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum