- 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
Bit-processing group in 8051
In 8051 Microcontroller there is 17 different instructions under the Logical Group. In total there are 17 opcodes. The Carry Flag (CY) acts like the single-bit accumulator in different bit processing instructions.
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 | Execution Time | Opcode Count |
---|---|---|---|
CLR C | 1 | 1 | 1 |
CLR bit | 2 | 1 | 1 |
SETB C | 1 | 1 | 1 |
SETB bit | 2 | 1 | 1 |
CPL C | 1 | 1 | 1 |
CPL bit | 2 | 1 | 1 |
ANL C, bit | 2 | 2 | 1 |
ANL C, /bit | 2 | 2 | 1 |
ORL C, bit | 2 | 2 | 1 |
ORL C, /bit | 2 | 2 | 1 |
MOV C, bit | 2 | 1 | 1 |
MOV bit, C | 2 | 2 | 1 |
JC rel | 2 | 2 | 1 |
JNC rel | 2 | 2 | 1 |
JB bit, rel | 3 | 2 | 1 |
JNB bit, rel | 3 | 2 | 1 |
JBC bit, rel | 3 | 2 | 1 |
Examples
Sr.No | Instruction & Description |
---|---|
1 | CLR C This instruction is used to clear the carry flag to 0. |
2 | SETB 0D5H This instruction of type SETB bit. It sets to 1bit. Here the bit is D5 (which is the F0 pin of PSW). This instruction can also be written like this SETB PSW.5 or SETB F0. |
3 | CPL C It complements the content of Carry Flag |
4 | ANL C, 07 Using this instruction, it ANDs the C-bit with bit 7. (Here 7 indicates the MS bit in internal RAM location20H.) |
5 | ORL C, /07 This instruction ORs the C-bit with the complement of bit 7. |
6 | MOV C, 05 This instruction will move the content of bit 5to carry. |
7 | JC LABEL This is a jump instruction. When the Carry flag is 1, it will jump to the LABEL. |
8 | JNB 80H, LABEL By this instruction, when LS bit of Port 0 is low, then it jumps to the LABEL. |
9 | JBC 80H, LABEL The JBC stands for Jump if the bit is set, then clear the bit. When LS bit of port P0 is high, it humps to the location pointed by LABEL. |
- Related Articles
- Bit manipulation program in 8051
- Arithmetic group in 8051
- Logical Group in 8051
- Data transfer group in 8051
- Program branch group in 8051
- 8051 Program to Add two 8 Bit numbers
- 8051 Program to Subtract two 8 Bit numbers
- 8051 Program to Multiply two 8 Bit numbers
- 8051 Program to Divide two 8 Bit numbers
- Program to Subtract two 8 Bit numbers in 8051 Microprocessor
- Program to Multiply two 8 Bit numbers in 8051 Microprocessor
- Program to Divide two 8 Bit numbers in 8051 Microprocessor
- 8051 Microcontroller
- Interrupt handing in 8051
- Difference between Batch Processing and Stream Processing

Advertisements