Difficulty: Easy
Correct Answer: MOV R2, P3
Explanation:
Introduction / Context:
8051 supports register-to-direct, direct-to-register, and accumulator-based data moves. Knowing valid addressing forms helps avoid assembler errors and unintended side effects.
Given Data / Assumptions:
Concept / Approach:
The instruction format MOV Rn, direct is valid: it copies the byte at a direct address (such as SFR P3) into a working register Rn. Thus MOV R2, P3 transfers the Port 3 value into R2 in a single instruction.
Step-by-Step Solution:
Verification / Alternative check:
Referencing the 8051 instruction set shows opcodes MOV Rn, direct (A8–AF opcodes) are legal and execute in 2 bytes, 2 machine cycles on many variants.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting that ports are SFRs and can be accessed via direct addressing; mixing up source/destination order in MOV.
Final Answer:
MOV R2, P3
Discussion & Comments