8051 indirect addressing semantics What does the instruction MOV A, @R1 do in the 8051?
-
Acopy R1 to the accumulator
-
Bcopy the accumulator to R1
-
Ccopy the contents of memory whose address is in R1 to the accumulator
-
Dcopy the accumulator to the contents of memory whose address is in R1
Answer
Correct Answer: copy the contents of memory whose address is in R1 to the accumulator
Explanation
Introduction / Context:Indirect addressing allows access to internal RAM using a register as a pointer. This question checks your understanding of the 8051 syntax @R1, which dereferences R1 to obtain the target byte.
Given Data / Assumptions:
- @R1 means “address contained in R1”.
- MOV A, @R1 reads from internal data memory at that address.
- R0 or R1 are valid indirect address registers in the 8051.
Concept / Approach:Dereferencing R1 provides a byte from internal data memory 0x00–0x7F (lower 128) or indirectly from 0x00–0xFF on variants; the byte is then moved into A. No flags are affected by the addressing mode itself.
Step-by-Step Solution:
1) Fetch R1 → contains an 8-bit address n.2) Read internal RAM at address n → value m.3) Load accumulator A with m.4) R1 remains unchanged; only A receives the byte.Verification / Alternative check:Compare with MOV @R1, A which writes A to the addressed memory, confirming the direction of transfer is reversed in that form.
Why Other Options Are Wrong:
- Copy R1 to A: That would be MOV A, R1.
- Copy A to R1: That would be MOV R1, A.
- Copy A to memory at R1: That would be MOV @R1, A.
Common Pitfalls:Confusing register direct (R1) with register indirect (@R1) addressing, and mixing up source/destination order.
Final Answer:copy the contents of memory whose address is in R1 to the accumulator