0

See image: Dolphin Emulator setup

I am attempting to use Dolphin Wii emulator's debugger. It emulates a Broadway microprocessor (https://en.wikipedia.org/wiki/Broadway_(microprocessor)). The green bar indicates the next instruction that will be performed. If r0 = 0000006c and r3 = 817d34e0, what will the result of lwzx r3, r3, r0 be?

Dolphin says the result is r3 = 920d5fd0 when I step into that instruction. I though the result would be the sum of r3 and r0 stored in r3 so r3 should equal 817d354c.

Where have I gone wrong?

The debugger is known to have some issues so there could be a problem with it but I'm assuming I'm wrong.

Thanks!

Ebola16
  • 59
  • 9
  • 3
    Isn't `lwzx` a load? The content of `MEM[R3+R0]` should be in `R3`. Note that it seems this instruction is not symmetric: `lwzx r3, r0, r3` should load `MEM[R3]`. See [this](http://www.tentech.ca/downloads/other/PPC_Quick_Ref_Card-Rev1_Oct12_2010.pdf). – Margaret Bloom Oct 19 '17 at 15:16
  • @MargaretBloom Yes, Dolphin's result confuses me. Perhaps something is actually wrong with the debugger? – Ebola16 Oct 19 '17 at 20:21

1 Answers1

0

Found the answer on a different forum https://forums.dolphin-emu.org/Thread-powerpc-lwzx?pid=454986#pid454986.

Quote from JonnyH:

lwzx[0] appears to be a "load word from address" instruction - from my understanding it doesn't store the result of (r3 + r0) in r3, but it stores the memory value at address (r3 + r0) into r3. So presumably there's the value 0x920d5fd0 in the memory at address 0x817d354c? [0] https://www.ibm.com/support/knowledgecenter/en/ssw_aix_71/com.ibm.aix.alangref/idalangref_lwzx_lx_lwzi_instrus.htm

Ebola16
  • 59
  • 9