TangLMalan 2015-06-15 00:58 采纳率: 0%
浏览 2244

关于8086CPU标志寄存器溢出的问题

文章说,对于溢出只是针对于有符号数,但是对于无符号数,比如8为寄存器,表示的
范围是0~255,如果两个正数相加超过了255,不叫溢出了吗?为什么这里只讨论的是有
符号的数

  • 写回答

1条回答 默认 最新

  • nswcfd 2015-06-15 04:08
    关注

    手头没有8086的文档,模糊记得eflags里面有CF和OF两个标记,你说的“溢出”应该对应CF,即产生了进位。OF对于有符号数。

    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 (bit 0) Carry flag — Set if an arithmetic operation generates a carry or a borrow out of the mostsignificant
    bit of the result; cleared otherwise. This flag indicates an overflow condition for
    unsigned-integer arithmetic.
    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.

    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大