would doing arithmetic operation on a pair of signed and unsigned numbers be legal?

后端 未结 5 1485
忘了有多久
忘了有多久 2021-01-03 02:23

I\'m more than half way through learning assembly and I\'m familiar with the concept of how signed and unsigned integers are presented in bits, I know that it might seem a w

5条回答
  •  囚心锁ツ
    2021-01-03 02:43

    "Signed" and "unsigned" are interpretations. An assembly instruction will generally have the interpretation documented. I am not aware of any architecture where there's an ADD-SIGNED-UNSIGNED instruction that interprets one of its arguments as a signed value and one as unsigned. There seems to be little value in it, too. With 2s complement integer arithmetic, the only difference would be in some flag registers anyway.

提交回复
热议问题