Overflow flag & Carry flag

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章