[U-Boot-Users] PPC 405 _start code - Clarification

Wolfgang Denk wd at denx.de
Sat Dec 14 21:47:23 CET 2002


Dear Jerry,

in message <EGEGIJHKDKJGAJMGIDPNCEHJCCAA.jwalden at digitalatlantic.com> you wrote:
> Thanks for the clarification!

You are welcome.

> I am used to the x86 world, and when I disassemble something, I
> am used to seeing a one for one mapping from instruction to op-code.

This is the same with PowerPC. But there may  be  several  equivalent
mnemonics  to  encode  the  same  instruction.  The  green book ("The
Programming  Environments")  says:  "To  simplify  assembly  language
programming,  a  set of simplified mnemonics (referred to as extended
mnemonics in the architecture specification) and symbols is  provided
..."

> It is obvious that I need to become more proficient in PPC assembly,
> how could you tell that the instruction we "equivalent" - did you
> use a tool, or is it that you are simply that familiar with the PPC
> assembly code.

In this case I didn't need a book; but you can actually look  it  up.
For example your first statement:

> 	addi	r4,r0,0x0000

The green book lists for "addi":

	addi rD,rA,SIMM

and the simplified mnemonics:

	li   rD,value     equivalent to   addi rD,0,value
	la   rD,disp(rA)  equivalent to   addi rD,rA,disp
	subi rD,rA,value  equivalent to   addi rD,rA,-value

The listing you got from the disassembler:

> fff80100:	38 80 00 00 	li	r4,0

obviously matches rule 1 (well, it's only obvious if  you  now  about
the special role or R0 in such cases :-).


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Where people stand is not as important as which way they face.
        - Terry Pratchett & Stephen Briggs, _The Discworld Companion_




More information about the U-Boot mailing list