Two of the bits in the FLAGS register that add and sub instructions set are overflow and carry flag:
Overflow flag:
Set for signed arithmetic when the ture result is too big to fit into the destination.
Carry flag:
If there is a carry in the MSB of an addition or a borrow in the MSB of a subtraction, the carry flag is set. Thus, it can be used to detect overflow for unsigned arithmetic.
博客介绍了FLAGS寄存器中加法和减法指令设置的两个标志位:溢出标志位和进位标志位。溢出标志位用于有符号算术运算,当真实结果太大无法存入目标时设置;进位标志位在加法最高有效位有进位或减法最高有效位有借位时设置,可用于检测无符号算术运算的溢出。
1884

被折叠的 条评论
为什么被折叠?



