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 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图2.0 版本点聚合中Marker的位置无法实时更新,如何解决呢?
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题