Вы находитесь на странице: 1из 15

LOGICAL GROUP

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

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

LOGICAL GROUP
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
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
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
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 After execution C= 17H, C= 17H, A=10H A=17H

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 After execution Data= 17H, Data= 17H, A=10H A=17H

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 After execution M= 17H, M= 17H, A=10H A=17H

LOGICAL GROUP
XRA R
(Logically XOR register content with Acc and result in A)

[A] [A]
Example:

[r]

XRA C (XOR the content of C with A). Suppose the Data at C register is 17H. Initially After execution A=10H,C= 17H A=07H,C=17H.

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

[A] [A]
Example:

[Data]

XRI 17 (XOR the Data with A). Suppose the Data is 17H. Initially After execution A=10H,Data=17H A=07H,Data=17H.

LOGICAL GROUP
XRA M
(Logically XOR memory content with Acc and result in A)

[A] [A]
Example:

[M]

XRA M (XOR the content of memory with A). Suppose the memory content is 17H. Initially After execution A=10H,M= 17H A=07H,M=17H.

LOGICAL GROUP
CMA. (Complement the accumulator) [A] [A]
Example: CMA (Complement the accumulator0

Suppose the Data at accumulator is FFH.


Initially After execution A=FFH A=00H

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]

CS

A7

A6

A5

A4

A3

A2

A1

A0

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]

CS

A7

A6

A5

A4

A3

A2

A1

A0

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]

CS

A7

A6

A5

A4

A3

A2

A1

A0

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]

CS

A7

A6

A5

A4

A3

A2

A1

A0

Вам также может понравиться