Logical Group

download Logical Group

of 15

Transcript of Logical Group

  • 7/29/2019 Logical Group

    1/15

    The Instructions under this group perform logicaloperation such as AND, OR, compare, rotate etc.

    Examples are: ANA, XRA, ORA, CMP, and RAL etc.

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    2/15

    ANA R

    (Logically AND content of register with Acc and result in A )

    [A] [A] ^ [r]Example:

    ANA C (AND the content of C with A).Suppose the Data at C register is 10H.

    Initially C= 10H, A=10H

    After execution A= 10H, C=10H.

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    3/15

    ANI Data

    (Logically AND immediate data with Acc and result in A )

    [A] [A] ^ [data]Example:

    ANI 10 (AND the data with A).Suppose the Data is 10H.

    Initially Data = 10H, A=10H

    After execution Data = 10H, A=10H.

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    4/15

    ANA M

    (Logically AND content of memory with Acc and result in A )

    [A] [A] ^ [M]Example:

    ANA M (AND the content of memory with A).Suppose the content of memory is 10H.

    Initially M=10H, A = 10H

    After execution M=10H, A = 10H

    .

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    5/15

    LOGICAL GROUP

    ORA R

    (Logically OR register content with Acc and result in A)

    [A] [A] v [r]Example:

    ORA C (OR the content of C with A).

    Suppose the Data at C register is 17H.

    Initially C= 17H, A=10H

    After execution C= 17H, A=17H

  • 7/29/2019 Logical Group

    6/15

    LOGICAL GROUP

    ORI Data

    (Logically OR immediate Data with Acc and result in A ).

    [A] [A] v [Data]Example:

    ORI 17 (OR the Data with A).

    Suppose the Data is 17H.

    Initially Data= 17H, A=10H

    After execution Data= 17H, A=17H

  • 7/29/2019 Logical Group

    7/15

    LOGICAL GROUP

    ORA M

    (Logically OR memory content with Acc and result in A).

    [A] [A] v [M]Example:

    ORA C (OR the content of memory with A).

    Suppose the Data at memory is 17H.

    Initially M= 17H, A=10H

    After execution M= 17H, A=17H

  • 7/29/2019 Logical Group

    8/15

    XRA R

    (Logically XOR register content with Acc and result in A)

    [A] [A] [r]Example:

    XRA C (XOR the content of C with A).

    Suppose the Data at C register is 17H.

    Initially A=10H,C= 17H

    After execution A=07H,C=17H.

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    9/15

    XRI Data

    (Logically XOR immediate Data with Acc and result in A)

    [A] [A] [Data]Example:

    XRI 17 (XOR the Data with A).

    Suppose the Data is 17H.

    Initially A=10H,Data=17H

    After execution A=07H,Data=17H.

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    10/15

    XRA M

    (Logically XOR memory content with Acc and result in A)

    [A] [A] [M]Example:

    XRA M (XOR the content of memory with A).

    Suppose the memory content is 17H.

    Initially A=10H,M= 17H

    After execution A=07H,M=17H.

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    11/15

    CMA.

    (Complement the accumulator)

    [A] [A]Example:

    CMA (Complement the accumulator0

    Suppose the Data at accumulator is FFH.

    Initially A=FFH

    After execution A=00H

    LOGICAL GROUP

  • 7/29/2019 Logical Group

    12/15

    LOGICAL GROUP

    RLC (Rotate accumulator left)The content of the accumulator is rotated left by one

    bit. The seventh bit of the accumulator is moved to carry

    bit as well as to the zero bit of the accumulator. Only CS

    flag is affected.[An+1] [An], [A0] [A7], [CS] [A7]

    A7 A6 A5 A3A4 A1A2 A0CS

  • 7/29/2019 Logical Group

    13/15

    LOGICAL GROUP

    RRC. (Rotate accumulator right)

    The content of the accumulator is rotated right by one

    bit. The zero bit of the accumulator is moved to the

    seventh bit as well as to carry bit. Only CS flag is

    affected.

    [An][An+1] , [CS] [A0] , [A7][A0]

    A7 A6 A5 A3A4 A1A2 A0CS

  • 7/29/2019 Logical Group

    14/15

    LOGICAL GROUP

    RAL (Rotate accumulator left through carry)

    The content of the accumulator is rotated left by one

    bit. The seventh bit of the accumulator is moved to carry

    bit & carry bit to the zero bit of the accumulator. Only CS

    flag is affected.[An+1] [An], [A0] [CS], [CS] [A7]

    A7 A6 A5 A3A4 A1A2 A0CS

  • 7/29/2019 Logical Group

    15/15

    LOGICAL GROUP

    RAR. (Rotate accumulator right through carry)

    The content of the accumulator is rotated right by one

    bit. The zero bit of the accumulator is moved to the to

    carry bit & carry bit to the seventh bit. Only CS flag is

    affected.

    [An][An+1] , [CS][A0], [A7][CS]

    A7 A6 A5 A3A4 A1A2 A0CS