WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: Bully@Wiiplaza on June 10, 2013, 12:27:50 PM

Title: r0 Value Operations
Post by: Bully@Wiiplaza on June 10, 2013, 12:27:50 PM
I´ve noticed working with values in r0 is unconvenient.
Addi r0, r0, IMM becomes li r0, IMM. Ori r0, r0, IMM becomes nop and there are more. :(

Is there a way to still modify r0 this way or do I really need to move it´s content first?
I guess not.

Why do there need to be ambiguous opcodes even when they really aren´t?
Combinations don´t run out that quickly.
Title: Re: r0 Value Operations
Post by: megazig on June 10, 2013, 05:19:02 PM
they become those because they don't use r0

addi r0, r0, IMM in your case is really addi 0, 0, IMM. the r part is just for show. and when dealing with that instruction, a 0 in the rS means value 0 instead of register 0. so you have addi r0, 0, IMM. which just means put IMM into r0. hence li r0, IMM. it's not that li is an instruction, it's that it is the effect of 0 being the rS.  6xx_pem.pdf and go through all the instructions. there's lots of them that take 0 value instead of register when doing rS|rA = 0