Difficulty: Medium
Correct Answer: MOV P1, @ R0
Explanation:
Introduction / Context:
Indirect addressing with @R0 or @R1 allows the 8051 to access a RAM location whose address is held in a register. Understanding legal source and destination forms is key to moving data between RAM and special function registers like P1.
Given Data / Assumptions:
Concept / Approach:
Legal forms include MOV direct, @Ri and MOV direct, A and MOV direct, @Ri (source indirect to direct). To copy RAM[@R0] to P1, the destination must be direct (P1) and the source must be indirect (@R0). Thus MOV P1, @R0 is the correct encoding.
Step-by-Step Solution:
1) Determine direction: RAM[@R0] → P1.2) Select instruction form: MOV direct, @Ri.3) Substitute operands: direct=P1, @Ri=@R0.4) The legal statement is MOV P1, @R0.
Verification / Alternative check:
Assembler manuals list MOV direct, @Ri as a valid form. Simulators or assemblers will accept MOV P1, @R0 and produce the corresponding opcode.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing the contents of R0 with the byte pointed to by @R0; forgetting that port SFRs are direct addressed destinations.
Final Answer:
MOV P1, @ R0
Discussion & Comments