📜  计算机组织中的数据处理说明

📅  最后修改于: 2021-08-24 04:42:01             🧑  作者: Mango

数据处理说明:
数据操作指令对数据执行操作,并为计算机提供计算能力。典型计算机中的数据操作指令通常分为以下三种基本类型。

  1. 算术指令
  2. 逻辑和位操作指令
  3. 班次说明

让我们一一讨论。

  1. 算术指令:
    四个基本算术运算是加,减,乘和除。大多数计算机都提供所有这四个操作的说明。

    典型的算术指令–

    Name Mnemonic Example Explanation
    Increment INC INC B

    It will increment the register B by 1  

     B<-B+1

    Decrement DEC DEC B

    It will decrement the register B by 1  

    B<-B-1

    Add ADD ADD B

    It will add contents of register B to the contents of the  accumulator

     and store the result in the accumulator  

    AC<-AC+B

    Subtract SUB SUB B

    It will subtract the contents of register B from the contents of the 

    accumulator  and store the result in the accumulator

    AC<-AC-B

    Multiply MUL MUL B

    It will multiply the contents of register B with the contents of the 

    accumulator and store the result in the accumulator

    AC<-AC*B

    Divide DIV DIV B

    It will divide the contents of register B with the contents of the 

    accumulator and store the quotient in the accumulator

    AC<-AC/B

    Add with carry  ADDC ADDC B 

    It will add the contents of register B and the carry flag with the

    contents of the accumulator and store the result in the 

    accumulator

    AC<-AC+B+Carry flag

    Subtract with borrow SUBB SUBB B

    It will subtract the contents of register B and the carry flag from 

    the contents of the accumulator and store the result in the 

    accumulator

    AC<-AC-B-Carry flag

    Negate(2’s complement) NEG NEG  B

    It will negate a value by finding 2’s complement of its single operand.

    This means simply operand by -1.

    B<-B’+1

  2. 逻辑和位操作说明:
    逻辑指令对存储在寄存器中的位字符串执行二进制运算。它们对于处理单个位或一组位很有用。

    典型的逻辑和位操作指令–

    Name Mnemonic Example Explanation
    Clear CLR CLR 

    It will set the accumulator to 0 

    AC<-0

    Complement COM COM A

    It will complement the accumulator

    AC<-(AC)’

    AND AND AND B

    It will AND the contents of register B with the contents of accumulator and store 

    it in the accumulator

    AC<-AC AND B

    OR OR OR B

    It will OR the contents of register B with the contents of accumulator and store it

    in the accumulator

    AC<-AC OR B

    Exclusive-OR XOR XOR B

    It will XOR the contents of register B with the contents of the accumulator and 

    store it in the accumulator

    AC<-AC XOR B

    Clear carry CLRC CLRC

    It will set the carry flag to 0

    Carry flag<-0

    Set carry SETC SETC

    It will set the carry flag to 1

    Carry flag<-1

    Complement carry COMC COMC

    It will complement the carry flag

    Carry flag<- (Carry flag)’

    Enable interrupt EI EI It will enable the interrupt
    Disable interrupt DI DI It will disable the interrupt
  3. 班次说明:
    移位是将单词的位向左或向右移动的操作。移位指令可以指定逻辑移位,算术移位或旋转类型的操作。

    典型的换档说明–

    Name Mnemonic
    Logical shift right SHR
    Logical shift left SHL
    Arithmetic shift right SHRA
    Arithmetic shift left SHLA
    Rotate right ROR
    Rotate left ROL
    Rotate right through carry RORC
    Rotate left through carry ROLC

    有关换档指令,请参考此参考的换档指令