mikroC
making it simple...
Bitwise Operators
Use the bitwise operators to modify the individual bits of numerical operands.
Bitwise operators associate from left to right. The only exception is the bitwise
complement operator
Bitwise Operators Overview
Note: Operator
more information.
Bitwise operators
bits of their operands. For example:
0x1234 & 0x5678;
/* because ..
0x1234 : 0001 0010 0011 0100
0x5678 : 0101 0110 0111 1000
---------------------------------
&
.. that is, 0x1230 */
MikroElektronika: Development tools - Books - Compilers
which associates from right to left.
~
Operator
bitwise AND; returns 1 if both bits are 1, oth-
&
erwise returns 0
bitwise (inclusive) OR; returns 1 if either or
|
both bits are 1, otherwise returns 0
bitwise exclusive OR (XOR); returns 1 if the
^
bits are complementary, otherwise 0
bitwise complement (unary); inverts each bit
~
bitwise shift left; moves the bits to the left,
>>
see below
bitwise shift right; moves the bits to the right,
<<
see below
can also be the pointer reference operator. Refer to Pointers for
&
,
, and
&
|
^
: 0001 0010 0011 0000
mikroC - C Compiler for Microchip PIC microcontrollers
Operation
perform logical operations on appropriate pairs of
/* equals 0x1230 */
Precedence
9
9
10
10
10
10
page
105
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?