Question: A section of ARC assembly code is shown below. What does it do? Express your answer in terms of the actions it goes through. Does
A section of ARC assembly code is shown below. What does it do? Express your answer in terms of the actions it goes through. Does it add up numbers, or clear something out? Does it simulate a for loop, a while loop or something else? Assume that a and b are memory locations that are defined elsewhere in the code.
Y : ld [k], %r1
addcc %r1, -4, %r1
st %r1, [k]
bneg X
ld [a+%r1], %r2
ld [b+%r1], %r3
addcc %r2, %r3, %r4
st %r4, [%r1+c]
ba Y
X : jmpl %r15 + 4, %r0
k : 40
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
