Question: 1. Review the code and answer the following questions: Note: ArcTool throws a syntax error when there is not a return after .end. File must

1. Review the code and answer the following questions:

Note: ArcTool throws a syntax error when there is not a return after .end. File must end in a blank line.

.begin

main: add %r0, %r0, %r1

ld [k], %r5

call Y

halt

.org 1024

Y: subcc %r5, %r1, %r6

st %r6, [k]

bneg X

ld %r1, [a], %r2

ld %r1, [b], %r3

add %r2, %r3, %r4

st %r4, %r1, [c]

addcc %r1, 4, %r1

ba Y

X: jmpl %r15 +4, %r0

k: 40

.org 2048

a: 0, 1, 1, 1, 2, 3, 5, 8, 13

.org 2176

b: 0, 0, 0, 1, 1, 2, 3, 5, 8

.org 2304

c: -1, -1, -1, -1, -1, -1, -1, -1, -1

.end

a. Highlight the correct functionality of the subroutine Y

i. add integers a + b and store in c, break while loop when k = 0

ii. add arrays a + b and store in array c, break while loop when k > 0

iii. add arrays a + b and store in array c, break while loop when k < 0

iv. add integers a + b and store in c, break while loop when k < 0

v. add arrays a + b and store in array c, break while loop when k = 0

vi. add integers a + b and store in c, break while loop when k > 0

b. What is the final value for c:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!