Assembly - The sign flag & parity flag

前端 未结 2 1855
心在旅途
心在旅途 2021-01-29 03:35

I didn\'t understand when the sign flag is set, and when the parity.

As I know, the sign flag indicates the sign of the result of an operation, 0 for positive numbers an

2条回答
  •  礼貌的吻别
    2021-01-29 04:04

    The code

    mov al, -5 
    sub al, 124
    

    calculates 256-5-124. It's 127 and it's positive number

    Both sub al, al and 127+129 evaluates to 0, it has 0 bits set, and 0 is even value, so PF is set.

提交回复
热议问题