How to invert all bits in ASM (NOT instruction)
peterz
Posts: 59
Is there an equivalent to NOT instruction in ASM ?
I want to invert all bits in a variable located in an ASM block.
·
I want to invert all bits in a variable located in an ASM block.
·
Comments
Or XOR with 111111.......
Graham
p.s. This is really handy: http://forums.parallax.com/forums/default.aspx?f=25&m=157555
For example I cannot do:
xor t1,#$FFFFFFFF
-- Remy
That wouldn't actually work - it would and the ORIGINAL value with it's inverted value, resulting in zero. eg.
if you'd andn %1001 with itself, the result would be %1001 & %0110 = %0000. Therefore XORing with $FF_FF_FF_FF seems to be the only real option.