"not" opcode

Started by live2play, June 20, 2010, 10:40:22 PM

Previous topic - Next topic

live2play

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?  ???

Romaap

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.

dcx2

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.

live2play

Thank you both.  I appreciate it.