WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: live2play on June 20, 2010, 10:40:22 PM

Title: "not" opcode
Post by: live2play on June 20, 2010, 10:40:22 PM
Can someone please provide an example and explanation of how the not opcode works.  I've read that not rA, rS complements the contents of rS and places the result into rA.  Huh?  ???
Title: Re: "not" opcode
Post by: Romaap on June 20, 2010, 11:23:28 PM
I'm not 100% sure, but if I remember correctly it inverts the bits.
If you have Windows 7 you can test this by opening calculator and setting it to programmer mode (alt+3)(set it to DWord for 32-bits values) and type in a number and click the NOT button.
Title: Re: "not" opcode
Post by: dcx2 on June 20, 2010, 11:35:43 PM
There are two types of complements; the typical complement (sometimes referred to as "1's complement") which flips every bit, and a 2's complement that will essentially flip the sign of a signed integer (it is accomplished by "flipping the bits and add 1")

not 01010011 = 10101100

two's comp 01010011 = 10101101

not rA, rS is probably the one's comp.
Title: Re: "not" opcode
Post by: live2play on June 21, 2010, 01:17:55 AM
Thank you both.  I appreciate it.