大会 - 符号标志和放大器;奇偶标志 [英] Assembly - The sign flag & parity flag

查看:305
本文介绍了大会 - 符号标志和放大器;奇偶标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当符号标志设置我不明白,当奇偶校验。

据我所知,符号标志指示正数的操作,0和1为负数的结果的符号。

那么,为什么在接下来的code:

  MOV人,-5
分人,124

在SF为零?结果是否定的数目

关于PF,在为什么和b的PF设置?

  A)子人,人。B)MOV人,127
   加人,129


解决方案

在code

  MOV人,-5
分人,124

计算 256-5-124 。这是127,它是正数

两者子人,人 127 + 129 的计算结果为0,它设置为0的位,与0甚至价值,所以PF设置。

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 and 1 for negative numbers.

So why in the next code:

mov al, -5 
sub al, 124

The SF is zero? The result is negative number.

About the PF, Why in a and b, the PF is set?

a) sub al, al.

b) mov al, 127
   add al, 129

解决方案

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.

这篇关于大会 - 符号标志和放大器;奇偶标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆