Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the SPIM assembly language program loop1.s . ## ## Program Name: loop1.s ## ## - will calculate the sum of the elements in array.

Complete the SPIM assembly language program loop1.s.

 ## ## Program Name: loop1.s ## ## - will calculate the sum of the elements in "array". ## - "count" holds the number of elements in "array". ## ## ## - Output format must be ## "sum = 15" ## ## t0 - point to array elements in turn ## t1 - contains count of elements ## t2 - contains sum ## ## t3 - each word from array in turn ## ################################################# # # # text segment # # # ################################################# .text .globl __start __start: # execution starts here # Put your answer between dashed lines. # #------------------Your code starts next line--------------- #-----------------Your code ends above this line---------------- la $a0,endl # syscall to print out li $v0,4 # a new line syscall li $v0,10 # Exit syscall # Bye! ################################################# # # # data segment # # # ################################################# .data array: .word 3,4,2,6 count: .word 4 ans1: .asciiz "sum = " endl: .asciiz " " ## ## end of file loop1.s 

The program will calculate the sum of the elements in "array".

Here is the program skeleton; you will complete it.

Print out the sum in this format: "sum = 15"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions