Book CS:APP, using bit set and bit clear
If $z=\mathrm{bis}(x,m)$ then
$$
z_i = \begin{cases}
x_i &amp; \text{if } m_i = 0, \\
1 &amp; \text{otherwise}.
\end{cases}
$$
This is exactly bitwise OR.
If $z=\mathrm{bic}(x,m)$ then
$$
z_i = \begin{cases}
x_i &amp; \text{if } m_i = 0, \\
0 &amp; \text{otherwise}.
\end{cases}
$$
This is bitwise AND of $x$ and the bitwise complement of $m$.
In order to see how $\mathrm{bis}(\mathrm{bic}(x,y),\mathrm{bic}(y,x))$ computes bitwise XOR, we just need to compute the truth table:
$$
\begin{array}{c|c|c|c|c}
x &amp; y &amp; \mathrm{bic}(x,y) &amp; \mathrm{bic}(y,x) &amp; \mathrm{bis}(\mathrm{bic}(x,y),\mathrm{bic}(y,x)) \\\hline
0 &amp; 0 &amp; 0 &amp; 0 &amp; 0 \\
0 &amp; 1 &amp; 0 &amp; 1 &amp; 1 \\
1 &amp; 0 &amp; 1 &amp; 0 &amp; 1 \\
1 &amp; 1 &amp; 0 &amp; 0 &amp; 0
\end{array}
$$
Another way of seeing this is replacing $\mathrm{bis}(x,y)$ with $x \lor y$ (read: $x$ or $y$) and $\mathrm{bic}(x,y)$ with $x \land \lnot y$) (read: $x$ and not $y$):
$$
(x \land \lnot y) \lor (\lnot x \land y),
$$
which is one of the standard formulas for XOR. In C, it would look as follows: (x &amp; ~ y) | (~x &amp; y).