24.3.10 Bitwise Operations on Signed Values
Bitwise operations on signed values act on the two’s complement representation, including the sign bit. See also 24.3.11 Right-Shifting Signed Values.
Example
The following shows an example of a negative quantity involved in a bitwise AND
operation.
signed char output, input = -13;
output = input & 0x7E;
Under the CCI, the value of output after the
assignment is 0x72.Differences
All compilers have performed bitwise operations in an identical fashion to that described in this section.
Migration to the CCI
No action required.