Does anyone know why a cmpw would cause the Wii to freeze a the Wii Remote safety screen? The code below is just a simple example of that I'm doing. Once I added the cmpw/bne- portion to the code, the Wii encounters the freeze. I can't tell what's in the registers at this point as the Wii freezes before I can set the BP even thought I have auto run game disabled. The only reason I can think of is if their was a previous, pending cmpw or cmpwi that needed the value in the Condition Register (CR) and my cmpw was changing that value and causing the freeze. If this is the case, how do I guard against this? Do I push the CR onto the stack like the other registers (see r7 and r8 below)?
EDIT: I did correct the issue by moving my code to a section that was BEFORE the cmpwi that was setting the condition register prior to my code. However, I would still like to know the syntax for using cmpw safely by first saving the current value of the condition register and then restoring it after my code has completed.
EDIT: It seems that I could do an mfcr r# at the beginning of my code and then an mtcr r# at the end of my code execution. Will this do the trick?
stw r10,8(r5) -> Original instruction
stwu r1,-16(r1)
stw r7,8(r1)
stw r8,12(r1)
lis r7,0x1234
ori r7,r7,0x5678
cmpw r7,r10
bne- 0x08
lis r7,0x0000
lwz r7,8(r1)
lwz r8,12(r1)
addi r1,r1,16