Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Show me the steps to solve . data amount _ to _ add: . word 3 array _ length: . word 8 input _ array:
Show me the steps to solve
data
amounttoadd:
word
arraylength:
word
inputarray:
word
outputarray:
word
text
main:
# numremaining arraylength
# inputpointer inputarray
# outputpointer outputarray
# while numremaining
# outputpointer inputpointer amounttoadd
# inputpointer
# outputpointer
# numremaining
#
# TODO: add your code below.
# This should take each inputarray element, add amounttoadd,
# and store the result in the corresponding outputarray element.
# The elements in inputarray should never change. You can
# implement this however you'd like, though it's recommended to
# follow the above pseudocode.
# The code below prints all the elements of outputarray
# $t: number of elements remaining
# $t: pointer into output array
la $t arraylength
lw $t$t
la $t outputarray
# while $t
# print$t
# $t
# $t
#
printloopbegin:
beq $t $zero, printloopend
# print the integer
lw $a$t
li $v
syscall
# print a newline
li $a
li $v
syscall
# adjust variables
addi $t $t
addiu $t $t
j printloopbegin
printloopend:
# exit the program
li $v
syscall
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