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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started