zoukankan      html  css  js  c++  java
  • NV UP EI PL NZ NA PO NC的含义(转)

    原帖http://answers.yahoo.com/question/index?qid=20061110202234AATMzc7

    The types of flags within the simple 8086 CPU are as follows, with their abbreviation in parentheses:

    Overflow (OF)
    Direction (DF)
    Interrupt Enable (IF)
    Sign (SF)
    Zero (ZF)
    Auxillary Carry (AF)
    Parity (PF)
    Carry (CF)

    The functions of the flags are as follows ("cleared" means a value of 0 while "set" means a value of 1):

    OF - set if the result of a signed arithmetic or logic operation is too large of a positive number or too small of a negative number to fit into the CPU's registers..

    DF - set if the programmer wants to decrement the index registers (SI and DI) during string manipulation instructions. Cleared to 0 to increment.

    IF - set to allow external devices to interrupt the CPU for service requests

    SF - set if the most significant bit of an arithmetic/logic operation is set. Usually interpreted as a negative number when set.

    ZF - set if the result of an arithmetic/logic operation is equal to 0.

    AF - set if there was a carry from or borrow to bits 0-3 in the AL register.

    PF - set if the number of 1s (or parity) in the low-order byte is even.

    CF - set if there was a carry from or borrow to the most significant bit during last result calculation.

    Now we know what the flags do, but why do their abbreviations not match the ones in your question? Because the ones in your question refer to STATES of these flags, not the flags themselves per se.

    NV - means "no overflow", or the OF = 0

    UP - means that string manipulation instructions will cause the index registers to increment, or DI = 0

    EI - means interrupts are enabled, or IF = 1

    PL - means a number is positive, or the SF = 0

    NZ - means a number is not equal to 0, or the ZF = 0

    NA - means no bits were carried or borrowed from bits 0-3 of the AL regiater, or the AF = 0

    PO - means the number of ones is odd, or PF = 0

    NC - means no bits were carried or borrowed from the most significant bit, or CF = 0

    In conclusion, the 80x86 family has many more flags that do things such as processor control, program access control, power management, etc. Without these simple flags, computers would be utterly useless, not knowing how to compare and test binary data.

  • 相关阅读:
    图解IntelliJ IDEA v13应用服务器的运行配置
    探秘IntelliJ IDEA v13的应用服务器
    WebStorm中Node.js项目配置教程(1)——创建项目
    Web神器WebStorm 8.0测试版发放(慧都独家)
    三个创建WebStorm项目的方法
    清明假期【未完成】
    DOM查询
    正则表达式
    Httpservlet cannot be resolved to a type的原因与解决方法
    解决ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)【亲测有效】
  • 原文地址:https://www.cnblogs.com/cszlg/p/3063691.html
Copyright © 2011-2022 走看看