Subject: Re: PPC Assembler
To: Bruce J.A. Nourish <bjan+port-powerpc@bjan.net>
From: Jochen Roth <jochen@panix.com>
List: port-powerpc
Date: 07/17/2003 14:14:53
>  * What is the significance of a period after some mnemonics? IOW,
>    what is the difference between (say) addic and addic.?

Arithmetic ops with period will set bits in the condition register,
while those without will not. So if you want to e.g. jump based on
the result of an addic being non-zero, use 'addic.'.

>  * Why do some examples assume r0 is zero? Is this a good practice?
>    I notice that prep's locore.S immediately zeroes out r0. But is
>    this still a safe assumption in the presence of a C compiler?

Some instructions use the actual r0, some use the value 0 if r0 was
specified. To make things less complicated (for humans I suppose),
the convention of leaving r0 with value 0 at all times was adopted
by some ABIs, I think.

>  * I have Apple's guide to PPC assembler as my only reference. Is there
>    anything better out there? I would be willing to invest a modest
>    amount in a book.

Go to e-www.motorola.com and search for 'powerpc programming
environments' as a pdf. I don't have a link at hand. I think you can
also try ordering it on paper from either IBM or Motorola.

Regards,
Jochen