“相应地设置"什么?在英特尔大会上是什么意思? [英] What does "set accordingly" in Intel Assembly mean?

查看:82
本文介绍了“相应地设置"什么?在英特尔大会上是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我在Intel x86-64文档中看到的令人困惑的neg指令的内容.

Here is what I see in the documentation of Intel x86-64 for the neg instruction that is confusing.

" OF SF ZF AF PF 标志根据结果设置."

"The OF, SF, ZF, AF, and PF flags are set according to the result."

我假设sf = dest < 0zf = dest == 0,但无法弄清楚如何设置其他标志.

I'm assuming that sf = dest < 0, zf = dest == 0, but can't figure out how the other flags are set.

我到处都可以看到这个根据结果进行设置" 的短语,非常感谢您的帮助,以帮助您准确理解其含义.我正在使用编译器,因此信息肯定很重要.

I see this "set according to the result" phrase everywhere and would appreciate your help in understanding what it means precisely. I'm working on a compiler so the information is surely important.

推荐答案

因此,所有标志都是根据所执行的操作来设置的,这就是短语根据结果进行设置"的意思.

So all the of the flags are set based off the operation performed, which is what the phrase "set according to the result" means.

3.4.3.1状态标志

EFLAGS寄存器的状态标志(位0、2、4、6、7和11)指示算术指令的结果,例如ADD,SUB,MUL和DIV指令.状态标志功能是:

3.4.3.1 Status Flags

The status flags (bits 0, 2, 4, 6, 7, and 11) of the EFLAGS register indicate the results of arithmetic instructions, such as the ADD, SUB, MUL, and DIV instructions. The status flag functions are:

  • CF(位0)进位标志-如果算术运算从结果的最高有效位中产生进位或借位,则设置该位;否则,该位为1.否则清除.该标志指示无符号整数算法的溢出条件.它也用于多精度算术中.
  • PF(第2位)AF(第4位)辅助进位标志-如果算术运算从结果的第3位产生进位或借位,则设置该位;否则清除.此标志用于二进制编码的十进制(BCD)算法.
  • ZF(位6)零标志-如果结果为零,则设置;否则为0.否则清除.
  • SF(位7)符号标志-设置为等于结果的最高有效位,即有符号整数的符号位. (0表示正值,1表示负值.)
  • OF(位11)溢出标志 —整数结果是否正数太大或负数太小(不包括符号位)而无法放入目标操作数中;请设置整数.否则清除.该标志表示有符号整数(二进制补码)算法的溢出条件.
  • CF (bit 0) Carry flag — Set if an arithmetic operation generates a carry or a borrow out of the most- significant bit of the result; cleared otherwise. This flag indicates an overflow condition for unsigned-integer arithmetic. It is also used in multiple-precision arithmetic.
  • PF (bit 2) AF (bit 4) Auxiliary Carry flag — Set if an arithmetic operation generates a carry or a borrow out of bit 3 of the result; cleared otherwise. This flag is used in binary-coded decimal (BCD) arithmetic.
  • ZF (bit 6) Zero flag — Set if the result is zero; cleared otherwise.
  • SF (bit 7) Sign flag — Set equal to the most-significant bit of the result, which is the sign bit of a signed integer. (0 indicates a positive value and 1 indicates a negative value.)
  • OF (bit 11) Overflow flag — Set if the integer result is too large a positive number or too small a negative number (excluding the sign-bit) to fit in the destination operand; cleared otherwise. This flag indicates an overflow condition for signed-integer (two’s complement) arithmetic.

在这些状态标志中,只能使用STC,CLC和CMC指令直接修改CF标志.同样,位指令(BT,BTS,BTR和BTC)将指定的位复制到CF标志中.

Of these status flags, only the CF flag can be modified directly, using the STC, CLC, and CMC instructions. Also the bit instructions (BT, BTS, BTR, and BTC) copy a specified bit into the CF flag.

仅CF标志可以直接修改.其他的则根据操作进行设置.

Only the CF flag can be modified directly. The others are set based on the operations.

查看全文

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