Question Bank (3 marks) · Q10
Q.Briefly explain Logical instruction.
Karnataka PUCTextbookLong· 3mImportance★★★★★est
47% · 54/115 Questions
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →[!TLDR]
Logical instructions (ANL, ORL, XRL, CLR, SETB, CPL, RL, RLC, RR, RRC, SWAP) perform bitwise Boolean and bit-manipulation operations; the AND/OR/XOR forms leave flags unchanged, while RLC and RRC affect CY.
Logical instructions are among the most widely used instructions in the 8051. They are bitwise operations that let the program test and manipulate individual bits.
Two-operand (bitwise) instructions accept two 8-bit operands and store the result at the destination; no flags are affected by these:
- ANL — bitwise AND, dest = dest AND source.
- ORL — bitwise OR, dest = dest OR source.
- XRL — bitwise Exclusive-OR, dest = dest XOR source.
Single-operand instructions:
- CLR / SETB — clear or set a bit or the accumulator.
- CPL — complement (1's complement) the accumulator without affecting any flags.
- RL, RR — rotate the accumulator left or right; these do not affect any flag. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.