8051 addition syntax — which statement correctly adds register R3 to the Accumulator and stores the result back in A? Choose the valid 8051 ADD form that implements A ← A + R3.
-
AADD @R3, @A
-
BADD @A, R3
-
CADD R3, A
-
DADD A, R3
-
EADD A, @R3
Answer
Correct Answer: ADD A, R3
Explanation
Introduction / Context:Arithmetic instructions on the 8051 use specific operand order and addressing modes. For register-to-Accumulator addition, only certain encodings are legal. Picking the proper form avoids assembler errors and unexpected behavior.
Given Data / Assumptions:
- Goal: compute A ← A + R3
- Operands: Accumulator A and register R3 (from the current register bank)
Concept / Approach:The 8051 defines ADD A, src where src may be Rn, direct, @Ri, or immediate (#data). The destination is always A for ADD. There is no form ADD Rn, A, nor any form that addresses A indirectly (@A is invalid).
Step-by-Step Solution:
Required operation: A ← A + R3Valid encoding: ADD A, R3Assembler accepts Rn as a legal source; destination fixed to AVerification / Alternative check:Consult the ADD instruction table: legal sources include R0–R7, @R0/@R1, direct, and #immediate, always with A as destination.
Why Other Options Are Wrong:
- ADD @R3, @A and ADD @A, R3: use invalid addressing (@A is not defined; @R3 is not a legal indirect register).
- ADD R3, A: operand order illegal; destination cannot be R3.
- ADD A, @R3: uses indirect through R0/R1 only, not R3.
Common Pitfalls:
- Reversing operands and assuming symmetric arithmetic encodings.
Final Answer:ADD A, R3