How does assembly code know if a value is signed or unsigned?
问题 I get very confused when it seems like sometimes my code treats a certain value as signed and sometimes it treats it as unsigned when comparing values. How does the code know whether a value is signed or unsigned? 回答1: Why do you think that assembly code has to "know" if a value is signed or unsigned? For most operations the results of a signed and an usigned operation are the same: signed int a = 5; signed int b = -6; // 0xFFFFFFFA signed int c; c = a + b; // results in -1 which is