02-16-2004, 08:18 AM
Okay, the situation is I'm writing an encryption algo that uses string*1s, with XOR and NOT. My problem is that occasionally the algorithm results in the most-signifigant-bit (bit 7) being set. Which means that the number is negative.
The question is, is there a way to force an expression to treat bit 7 as any normal bit, not the sign-bit?
In C an expression that I want would be like this:
Of course, ~ is NOT and ^ is XOR.
The question is, is there a way to force an expression to treat bit 7 as any normal bit, not the sign-bit?
In C an expression that I want would be like this:
Code:
something1=(unsigned char) ~(something1 ^ something2);
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
--------------------------------------
Freebasic is like QB, except it doesn't suck.