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.

  • 相关阅读:
    ~随笔A007~html中input输入框的字数限制、同步input的输入内容至div中
    ~随笔A006~微信扫码的授权、用户绑定、关注公众号、消息反馈
    【CV】实验二:特征检测与匹配
    【笔记】DLX算法及常见应用
    【笔记】和算法无关的那些东东
    【笔记】康拓展开&逆康拓展开
    【笔记】离散对数
    【笔记】Shift-And算法&Shift-OR算法
    【模板】中缀表达式求值
    【笔记】数据库系统
  • 原文地址:https://www.cnblogs.com/cszlg/p/3063691.html
Copyright © 2011-2022 走看看