[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: PowerPC assembler help



Hi Brad,
> On Sun, Jun 09, 2013 at 10:03:14PM +1000, Erik de Castro Lopo wrote:
>> Hi all,
>>
>> Anyone know/understand PowerPC assembler?
>>
>> I have the instruction:
>>
>>     lwz     30, .label - (1b)(31)
>>
>> >From reading the documentation I could find, I have figured out that
>> it loads a 16 bit value into register 30. The rest has got me somewhat
>> flumoxed. Clues?
> I'm pretty sure that is loading a 32 bit value. I believe that 'h' is
> for 16 bit and 'w' is 32 bit. I haven't seen that syntax for the source,
> but my guess would be that it is an assembler directive of some sort
> that will get translated into a memory reference of a register/offset,
> but it seems like it would need to be PC-relative which that instruction
> wouldn't support directly anyway.

Yes, that's about it.  lwz loads 32 bits in 32-bit mode, or in 64-bit
mode loads 32 bits into the low half of the register and zeros into the
high half.  In this case reg 30.  .label would be the address being
loaded from.  I'm not sure about the (1b)(31) -- footnotes maybe??

Cheers,  Mike.


>
> Was this input for an assembler or output from a disassembler? If this
> is from a disassembly of a dynamically relocatable object, it might
> have gotten confused by an instruction being the target of a relocation.
>
> 	Brad Boyer
> 	flar@allandria.com
>
>


-- 
---------------------------------------------------------------
          Mike Hore        mike_hore@aapt.net.au
---------------------------------------------------------------


Reply to: