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|
|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|
|JB bit, rel||3||2||1|
|JNB bit, rel||3||2||1|
|JBC bit, rel||3||2||1|
|Sr.No|| Instruction & Description|
This instruction is used to clear the carry flag to 0.
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.
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.
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.