Click to See Complete Forum and Search --> : lwz not working properly?


Ciralia
September 19th, 2006, 02:12 PM
Here is the scenario:

Register 9 = 0x10000000 (this is an address in memory)
Register 0 = 0x00000000 (this is an address in memory)

The address 0x10000000 contains the value 0x12345678

The assembly instruction is: lwz R0, 0x0(R9)
This instruction is supposed to copy the value contained inside of the address in Register 9 into Register 0. So, Register 0 is supposed to now contain 0x1234567. But in reality I get:

Register 0 = 0x69215678

Somehow it looks like it is only copying the second half of the value. Does anyone know why this might happen? I am using GNU compiler on Windows XP.

Krishnaa
November 8th, 2006, 04:43 AM
LWZ loads the value of size WORD, looks like you want to copy double word value.