- Trending Categories
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
Logical Group in 8051
In 8051 Microcontroller there is 25 different instructions under the Logical Group. In total there are 49 opcodes. The Carry Flag (CY) affects only by instruction RRC and RLC.
In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.
Mnemonics | Byte Count | ExecutionTime | Opcode Count |
---|---|---|---|
ANL A, Rn | 1 | 1 | 8 |
ANL A, a8 | 2 | 1 | 1 |
ANL A, @Ri | 1 | 1 | 2 |
ANL A, #d8 | 2 | 1 | 1 |
ANL a8, A | 2 | 1 | 1 |
ANL a8, #d8 | 3 | 2 | 1 |
ORL A, Rn | 1 | 1 | 8 |
ORL A, a8 | 2 | 1 | 1 |
ORL A, @Ri | 1 | 1 | 2 |
ORL A, #d8 | 2 | 1 | 1 |
ORL a8, A | 2 | 1 | 1 |
ORL a8, #d8 | 3 | 2 | 1 |
XRL A, Rn | 1 | 1 | 8 |
XRL A, a8 | 2 | 1 | 1 |
XRL A, @Ri | 1 | 1 | 2 |
XRL A, #d8 | 2 | 1 | 1 |
XRL a8, A | 2 | 1 | 1 |
XRL a8, #d8 | 3 | 2 | 1 |
CLR A | 1 | 1 | 1 |
CPL A | 1 | 1 | 1 |
RL A | 1 | 1 | 1 |
RLC A | 1 | 1 | 1 |
RR A | 1 | 1 | 1 |
RRC A | 1 | 1 | 1 |
SWAP A | 1 | 1 | 1 |
Examples
Sr.No | Instruction & Description |
---|---|
1 | ANL A, R5 This is an example of type ANL A, Rn. In this instruction, the content of R5 will be ANDed with register A and store the result into A. Similarly the OR (ORL A, Rn) and Ex-OR(XRL A, Rn) also works. |
2 | CLR A It is clear instruction. Using this instruction the content of register A will be 00H. We cannot clear other registers content by using this instruction. |
3 | CPL A This instruction is used to complement each bit of register A. This instruction also cannot complement other registers data. |
4 | RL A This instruction is used for rotating the A register to the Left. This is equivalent to the RLC instruction of 8085. No flags are affected by this instruction. |
5 | RLC A This is similar to the RL A instruction, but it rotates through the Carrying flag. The RAL instruction of 8085 is similar to this instruction. By this instruction only carry flag is affected. |
6 | RR A This instruction can perform the reverse operation of RL A instruction. It rotates the A register content to the right. In 8085, the equivalent instruction was RRC. |
7 | RRC A This is Rotate Right through carrying. It affects the Carry Flag only. The equivalent instruction of this in 8085 was RAR. |
8 | SWAP A This instruction is used to swap LS Hex digit and MS Hex digits. This instruction is functionally same as executing RL A/RR A four times |
- Related Articles
- Arithmetic group in 8051
- Data transfer group in 8051
- Bit-processing group in 8051
- Program branch group in 8051
- Interrupt handing in 8051
- 8051 Microcontroller
- Logical Operators in C++
- Logical Properties in CSS
- Bit manipulation program in 8051
- Timers of 8051
- Logical instructions in 8086 microprocessor
- Logical Operator in Dart Programming
- Logical NOT in Arduino\n
- Logical Clock in Distributed System
- Binary to BCD conversion in 8051

Advertisements