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.

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器