Comparisons

xiaoxiao2021-03-06  83

INSTRUCTION: CMP

Compaling by Subtraction

For unsigned numbers:

2 bits in the flags register

ZF CF = 1 0> 0 0 <0 1

For Signed Numbers:

3 bits in the flags register

ZF of sf = 1 0> 0 1/0 1/0 <0 1/0 0/1

The Way of Examining Overflow:

Carry INTO MSB! = Carry Out of MSB

IF a posital a posital -> a negativeor a negative a negative -> a positivean overflow is generated

IF a NEGATIVE A POSITIVE OR A POSITIVE A NEGATIVETHERE WILL BE No Overflow

转载请注明原文地址:https://www.9cbs.com/read-94320.html

New Post(0)