71.3k views
3 votes
Get the sum of string numbers in ARM assembly.

a. ADD R0, R1, R2
b. SUM R0, R1, R2
c. ADDS R0, R1, R2
d. ADDSTR R0, R1, R2

User WEBProject
by
8.6k points

1 Answer

4 votes

Final answer:

The correct ARM assembly instruction to sum two registers and store the result in another register is 'ADD R0, R1, R2', which makes option a the correct answer. Therefore, the correct answer is a (ADD R0, R1, R2).

Step-by-step explanation:

The correct instruction to get the sum of two register values and store the result in another register in ARM assembly language is ADD R0, R1, R2. This instruction will add the values in R1 and R2 and store the result in R0. The option b (SUM R0, R1, R2) does not represent a valid ARM assembly instruction.

Option c (ADDS R0, R1, R2) adds the values and updates the condition flags accordingly, while option d (ADDSTR R0, R1, R2) is not a valid ARM instruction. Therefore, the answer is a (ADD R0, R1, R2). The 'S' suffix in the instruction sets the condition codes flags based on the result of the addition. This is useful for branching and conditional execution based on the sum.

User Beoliver
by
8.6k points