Hi ,I just started learning assembly ,and I have a question
when we add unsigned 255 and 1 in 8 bit registry CF=1 and OF=1 right,
and how do we realize if this numbers are sign or unsigned

7 Years
Discussion Span
Last Post by sDJh

Since the cpu doesn't distinguish signed from unsigned integers, the only way to check that an unsigned overflow happened is through the carry flag.
If the overflow flag is set, but not the carry flag, an unsigned overflow happened.
It only depends on your interpretation of the data.


ASM is the purest developing language available. It just translates Mnorics to hex code. The good thing is you can control up to 100 percent what your CPU is supposed to do.

CPUs dont distinguish between signed or unsigned variables. They don't even know the difference between datatypes. CPUs do whatever you want them to do.

So if you want to diplay bytes signed, you have to write your own procedure for that. In C this is done by testing the highest (7th) Bit of the Byte. If it's set to 1, then you have a negative number. If not, than it's positive.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.