Re: Question about powerpc branch instructions

2009-08-07 Thread Scott Wood
On Fri, Aug 07, 2009 at 05:47:00PM +0900, HongWoo Lee wrote:
> #2: Is b similar to the jmp in x86 ? 

Yes, specifically a relative near jmp.

> and bl is similar to the call in x86 ?

Sort of (and again, specifically a relative near call).  Call on x86
pushes the return address on the stack, while bl on powerpc puts the
return address in a special register (lr) that the called function has to
save on the stack itself if it wants to call another function.

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Question about powerpc branch instructions

2009-08-07 Thread Benjamin Herrenschmidt
On Fri, 2009-08-07 at 17:47 +0900, HongWoo Lee wrote:

> #1: Is there any special reason to concatenate 0b00 ?  Why 0b00 ??

Because instructions have to be aligned on 4 bytes boundaries ?

> #2: Is b similar to the jmp in x86 ? and bl is similar to the call in x86 ?

I'm not totally familiar with x86 but I "sounds" like it, though of
course they can be (ab)used in some more subtle ways.

Cheers,
Ben.

> Thanks in advance.
> 
> HongWoo.
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev