In what way does "NOT" not work ?
For
- b0 = NOT b1
the compiler generates the code ...
- b0 = b1 ^ $FFFF
Providing the variables on both sides of the '=' are of the same size ( bit/pin, byte/pins or word ), the operation will invert all bits of that variable.
Where the variables are of different sizes, the normal expand to 16-bits, do 16-bit arithmatic then truncate to fit destination applies which may give slightly odd or unexpected results, for example ...
- b0 = NOT pin0
will set b0 to $FE or $FF, not $00 or $01.
Edited by - hippy on 30/06/2006 13:45:06