PowerPC assembler help
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? Cheers, Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ -- To UNSUBSCRIBE, email to debian-powerpc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20130609220314.0b6f0447c83b2a79453e6...@mega-nerd.com
Re: PowerPC assembler help
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. 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 f...@allandria.com -- To UNSUBSCRIBE, email to debian-powerpc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/20130609234524.gb15...@cynthia.pants.nu
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 f...@allandria.com -- --- Mike Horemike_h...@aapt.net.au --- -- To UNSUBSCRIBE, email to debian-powerpc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/51b531fe.9020...@aapt.net.au