a number use in asm ,that time it is a sign number,and what time it is a unsign number.
Posted on 2003-08-28 03:01:02 by tomorrow
there are only a few mathematical instructions, which differ between signed and unsigned:

idiv vs. div
imul vs. mul

jg vs. ja
jl vs. jb

(first is signed, second unsigned)

maybe some more, but I mainly need to think about, if I use this ones.
Posted on 2003-08-28 05:31:54 by beaster
As asm is not type checked at run time, a number is signed when you treat at as such (typically the high bit being set means it is negative, therefore signed). If you take a number, you can do a signed or an unsigned operation on it, but the result may be different between the two operations because one treats the data as signed. Also your signed and unsigned operations will affect the flags differently (as beaster mentioned).
Posted on 2003-08-28 06:27:02 by sluggy
The sign bit actually only affects some opcodes. For some opcodes it is possible that the result is the same for both the signed version and the unsigned version, but this does not applies to all the opcodes. (That's why there is shl, sal but shr is the same as sar).

So in fact the cpu does not need to know when the number is unsigned or not, it is the opcodes that determine whether the number is signed or unsigned.
Posted on 2003-08-28 07:10:02 by roticv