CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    94

    Question lwz not working properly?

    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.
    "My software doesn't have bugs, it just develops random features."

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: lwz not working properly?

    LWZ loads the value of size WORD, looks like you want to copy double word value.
    Regards,
    Ramkrishna Pawar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured