Registers X1, X2, X3 have corresponding data stored in each location: X1: AX2: BX3: C Which set of ARM instructions will accomplish A=B+C?
Question
Which set of ARM instructions will accomplish A=B+C?
Registers X1, X2, X3 have corresponding data stored in each location:
X1: A
X2: B
X3: C
Solution
The set of ARM instructions to accomplish A=B+C would be:
- LDR R0, [X2] ; Load the value at memory location X2 (B) into register R0
- LDR R1, [X3] ; Load the value at memory location X3 (C) into register R1
- ADD R0, R0, R1 ; Add the values in register R0 and R1, store the result in R0
- STR R0, [X1] ; Store the value in register R0 at memory location X1 (A)
This set of instructions will result in A (X1) being equal to B (X2) + C (X3).
Similar Questions
19The value of b is stored in r1, c is stored in r2, and a is stored in r0. Which set of ARM instructions will accomplish a = b & c?
In ARM, PC is implemented using.........Select one:a. Dedicted Registersb. General Purpose Rgistersc. Cache Registerd. Stack Register
The registers, ALU and the interconnection between them are collectively called as _____
Each instruction in ARM machine is encoded into...........wordSelect one:a. 2 Byteb. 8 Bytec. 16 Byted. 4 Byte
Write assembly language instructions to perform the following tasks:I. Set the register AX equal to zero.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.