PDA

View Full Version : Bitwise Operators



SterlingY
- 15th March 2007, 05:41
Maybe I am just tired, but I can't figure out how to do bitwise operations on the lowest four bits of two numbers, without working on one bit at a time.

I saw the masking thread, but it didn't seem to answer my question.

Lets say:
A = %10100010
B = %00000100

how can I get to:
%10100100

-Sterling

paul borgmeier
- 15th March 2007, 05:50
C = (a & $f0) + (b & $0f)

SterlingY
- 15th March 2007, 05:57
Thank you!!!