Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

Common C Interface
2012-2013 Microchip Technology Inc. DS50002071C-page 27
2.4.9.3 MIGRATION TO THE CCI
No action required.
2.4.10 Bit-wise Operations on Signed Values
Bitwise operations on signed values act on the twos complement representation,
including the sign bit. See also Section 2.4.11 Right-shifting Signed Values.
2.4.10.1 EXAMPLE
The following shows an example of a negative quantity involved in a bitwise AND oper-
ation.
signed char output, input = -13;
output = input & 0x7E;
Under the CCI, the value of output after the assignment will be 0x72.
2.4.10.2 DIFFERENCES
All compilers have performed bitwise operations in an identical fashion to that
described in this section.
2.4.10.3 MIGRATION TO THE CCI
No action required.
2.4.11 Right-shifting Signed Values
Right-shifting a signed value will involve sign extension. This will preserve the sign of
the original value.
2.4.11.1 EXAMPLE
The following shows an example of a negative quantity involved in a bitwise AND
operation.
signed char input, output = -13;
output = input >> 3;
Under the CCI, the value of output after the assignment will be -2 (i.e., the bit pattern
0xFE).
2.4.11.2 DIFFERENCES
All compilers have performed right shifting as described in this section.
2.4.11.3 MIGRATION TO THE CCI
No action required.

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh