Arithmetic Overflow vs. Arithmetic Carry

后端 未结 2 1869
陌清茗
陌清茗 2021-02-01 04:14

One of my lecture slides gives an example of arithmetic overflow and carry in a topic for conditional branching flags on an ARM chip, quoted below:

  • V (overflow) - 
2条回答
  •  忘掉有多难
    2021-02-01 04:43

    You get an overflow, if the sign bit is corrupted. So you know that you have to adjust your result.

    You get a carry if the result does not fit in this value. (need more bits than you have).

    In the old days you had to write your own addition and multiplication subroutines for multi byte values.

提交回复
热议问题