Re: some basic problems with ppc assembler
On Wed, Jun 25, 2003 at 11:26:35AM +0200, Geert Uytterhoeven wrote:
> On Wed, 25 Jun 2003, Oliver Ripka wrote:
> > I try to understand some ppc-assembler-code but it is harder than
> > x86 to me because of the missing documentation. I have a big reference
> > from ibm here. And some websites which deal with this topic.
>
> There's lots of documentation about PPC assembler on the Motorola website, too.
>
> > .LC0: //I guess this means .LC0
> > .string "Hello World" //is a global string
> > .globl main //within the main label.
> >
> > .type main, @function //whats that for?
> > main:
> > stwu 1,-32(1) //I do not understand this.
>
> Store Word Unsigned, i.e. save r1 to address r1-32.
Bzzt, store word with update. Load and store instructions are
unsigend by default, the exceptions being lha (and lwa on
64 bit processors) where a stands for arithmetic.
This said the subroutine is obviously compiled with optimization
off. It's much easier to understand IMHO at -O2 since
it removes all the useless crap (well not always all
of it but quite a significant part).
Regards,
Gabriel
Reply to: