![]() |
VOOZH | about |
Logical instructions in the 8085 microprocessor are a set of instructions that perform logical operations on data in registers and memory. Logical operations are operations that manipulate the bits of data without affecting their numerical value. These operations include AND, OR, XOR, and NOT.
The logical instructions in the 8085 microprocessor include:
Performs a bitwise AND between the accumulator and a specified register or memory location, storing the result in the accumulator.
Performs a bitwise OR between the accumulator and a specified register or memory location, storing the result in the accumulator.
Performs a bitwise Exclusive OR between the accumulator and a specified register or memory location, storing the result in the accumulator.
Flips all bits of the accumulator, inverting its value.
Performs a bitwise complement of the accumulator, flipping all bits.
Here are some specific reasons why logical instructions are used in the 8085 microprocessor:
Following is the table showing the list of logical instructions:
In the table,
R stands for register, M stands for memory and Mc stands for memory contents.
| OPCODE and OPERAND | DESTINATION and EXAMPLE |
|---|---|
| ANA R | A = A AND R → ANA B |
| ANA M | A = A AND Mc → ANA 2050 |
| ANI 8-bit data | A = A AND 8-bit data → ANI 50 |
| ORA R | A = A OR R → ORA B |
| ORA M | A = A OR Mc → ORA 2050 |
| ORI 8-bit data | A = A OR 8-bit data → ORI 50 |
| XRA R | A = A XOR R → XRA B |
| XRA M | A = A XOR Mc → XRA 2050 |
| XRI 8-bit data | A = A XOR 8-bit data → XRI 50 |
| CMA | A = 1’s complement of A → CMA |
| CMP R | Compare R with A and set flags → CMP B |
| CMP M | Compare Mc with A and set flags → CMP 2050 |
| CPI 8-bit data | Compare 8-bit data with A and set flags → CPI 50 |
| RRC | Rotate accumulator right (no carry) → RRC |
| RLC | Rotate accumulator left (no carry) → RLC |
| RAR | Rotate accumulator right with carry → RAR |
| RAL | Rotate accumulator left with carry → RAL |
| CMC | Complement the carry flag → CMC |
| STC | Set the carry flag → STC |