HOME

TheInfoList



OR:

In a
computer A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations (computation) automatically. Modern digital electronic computers can perform generic sets of operations known as programs. These prog ...
processor the negative flag or sign flag is a single bit in a system status (flag) register used to indicate whether the result of the last mathematical operation produced a value in which the most significant bit (the left most bit) was set. In a
two's complement Two's complement is a mathematical operation to reversibly convert a positive binary number into a negative binary number with equivalent (but negative) value, using the binary digit with the greatest place value (the leftmost bit in big- endian ...
interpretation of the result, the negative flag is set if the result was negative. For example, in an 8-bit signed number system, -37 will be represented as 1101 1011 in binary (the most significant bit, or
sign bit In computer science, the sign bit is a bit in a signed number representation that indicates the sign of a number. Although only signed numeric data types have a sign bit, it is invariably located in the most significant bit position, so the ter ...
, is 1), while +37 will be represented as 0010 0101 (the most significant bit is 0). The negative flag is set according to the result in the
x86 x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel based on the Intel 8086 microprocessor and its 8088 variant. The 8086 was int ...
series processors by the following instructions (referring to the
Intel 80386 The Intel 386, originally released as 80386 and later renamed i386, is a 32-bit microprocessor introduced in 1985. The first versions had 275,000 transistorsINTEL 80386. Programmer's Reference Manual 1986
/ref>): * All arithmetic operations except multiplication and division; * compare instructions (equivalent to subtract instructions without storing the result); * Logical instructions – XOR, AND, OR; *
TEST Test(s), testing, or TEST may refer to: * Test (assessment), an educational assessment intended to measure the respondents' knowledge or other abilities Arts and entertainment * ''Test'' (2013 film), an American film * ''Test'' (2014 film), ...
instructions (equivalent to AND instructions without storing the result).


References

{{DEFAULTSORT:Negative Flag Computer arithmetic