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:
1) Determine source operand: SFR P3 (direct address).2) Determine destination: R2 (register in current bank).3) Use MOV R2, P3 to perform direct-to-register transfer.4) Assemble and verify addressing mode is supported.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