Page 48 - DCAP210_INTRODUCTION__TO_MICROPROCESSORS
P. 48
Introduction to Microprocessors
Notes
Table 3.4: List of Logical Instructions
Opcode Operand Description
ADD R Add
ANA R Logical ADD with Accumulator
(a) It is a 1-byte instruction
(b) Logically AND the contents of Register R with the
contents of Accumulator.
ANI 8-bit AND Immediate with Accumulator
(a) It is d 2-byte instruction
(b) Logically AND the 8-bit with the contents of Accumulator.
ORA R Logical OR with Accumulator
(a) It is a 1-byte instruction
(b) Logically OR the contents of Register R with the contents
of Accumulator.
ORI 8-bit OR Immediate with Accumulator
(a) It is a 2-byte instruction.
(b) Logical OR the 8-bit with the contents of the Accumulator.
XRA R Logical Exclusive—OR with Accumulator
(a) It is a 1-byte instruction.
(b) Exclusive—ORs the contents of Register R with the
contents of Accumulator.
XRI 8-bit Exclusive—OR Immediate with Accumulator
(a) It is a 2-byte instruction.
(b) Exclusive—OR the 8-bit with the contents of the
Accumulator.
CMA Complement Accumulator
(a) It is a 1-byte instruction.
(b) Complements the contents of the Accumulator.
(c) No flags are affected.
R represents any of registers A, B, C, D, E, H and L. In ANA, XRA, XRI and ANI instruction, CY is
reset and AC is set. When logical operation instructions are executed bitwise operations are
performed between the contents of Accumulator and contents of Register R or 8-bit data value.
Write a program by using INR and DCR opcode instruction.
Key Points about Logical Operations:
1. Logical operations are performed with the contents of the Accumulator and the result is
also stored in the Accumulator.
2. The contents of Accumulator are replaced with current one when a logical operation is
performed.
3. The contents of the source Register R is not altered during logical operations.
4. Logical operations cannot be performed directly using the contents of two registers.
42 LOVELY PROFESSIONAL UNIVERSITY