- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Instructions to perform OR operation in 8085 Microprocessor
In 8085 Instruction set, and specially in its logical group of instructions, we have AND, OR, XOR, NOT type of instructions. 8085 does not have instructions to perform NAND, NOR, XNOR operations directly. Now let us discuss the instructions to perform OR operations only.
To perform ORing of two numbers, 8085 imposes the restriction that one of the operands must be kept in the Accumulator. The other operand can be at any one of the following possible locations −
Classifications | Examples |
---|---|
The other operand can be kept in 8-bit immediate data in the instruction. | ORI 43H ORI FFH |
The other 8-bit operand can be kept in a memory location and whose memory address will be pointed by HL register pair. | ORA M |
The other 8-bit operand can be kept in a 8-bit register | ORA B ORA C |
Here is the list of instructions available in 8085 instruction set suitable for ORing operations −
Mnemonics, Operand | Opcode (in HEX) | Bytes |
---|---|---|
ORA A | B7 | 1 |
ORA B | B0 | 1 |
ORA C | B1 | 1 |
ORA D | B2 | 1 |
ORA E | B3 | 1 |
ORA H | B4 | 1 |
ORA L | B5 | 1 |
ORA M | B6 | 1 |
ORA Data | F6 | 2 |
The OR operation performs bit-wise OR of the two operands. If X is a bit of Accumulator, and Y is a bit of the other operand in the same bit position, the OR operation is performed as per the following truth table.
Truth Table for OR Operation
X | Y | X OR Y |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 1 |
The OR instruction will affect the flag register bits as follows −
- S, P, and Z flags are updated based on the result
- Cy and Ac flags are reset to 0