[U-Boot-Users] Newbie question

Ross A. Osborn rosborn at motorola.com
Mon May 10 20:28:05 CEST 2004


On Mon, May 10, 2004 at 01:55:32PM -0400, Frank Young wrote:
> The is not a u-boot question but a question about u-boot source code.
> 
> In file cpu/ppc4xx/start.S, the first line for 405GP is:
> addi r4, r0, 0x0000
> 
> I think the purpose of this line is to set r4 as 0x0000, but where is r0 
> set? Is it supposed to be 0 when the code is started?

r0 is a special case in a number of PPC assembly instructions.  In this
case it means that r4 is loaded with the sign extended immediate data.
No source register is involved.

> 
> Also, why not simply use li r4, 0x0000. Any difference?

No difference at all.  In fact there is no li instruction.  This is
a "simplified mnemonic" that your assembler will translate into an addi
instruction.

Ross




More information about the U-Boot mailing list