In this circumstance how would the application "know" whether to treat the register as containing a
positive or negative value? It seems to me that the value (80000000h) is completely ambiguous.
ok - the question is not "is it positive or negative"
the question should be "is it signed or unsigned"
it's an issue of
contextlet's step back and examine the use of signed vs unsigned values
this applies to bytes, words, dwords - any size integer, actually
but - let's use dwords
a dword is 32 bits wide
we may choose to use that 32 bits to represent an unsigned integer from 0 to 4294967295
well - Intel, as well as the designers of many other CPU's wanted to be able to use the same
register or memory location to store signed integers, at the programmers discretion
and - they wanted many instructions to work correctly, regardless of which was in use
so - two's compliment was born
now, we may use the 32 bits to represent values from -2147483648 to +2147483647
instructions like ADD and SUB still work for either integer type
that gives you a little background to help understand that whether the value represents a signed or unsigned integer is up to the programmer
so, the value 80000000h may represent a positive value of 2147483648 (unsigned)
or, it may represent a negative value of -2147483648 (signed)
it depends on the context in which the value is used
which is a choice the programmer makes when he writes the code