Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Arrays in MIPS could be stored in registers, that severely constraints what the array could do, no more than 32 elements, to the point that

Arrays in MIPS could be stored in registers, that severely constraints what the array could do, no more than 32 elements, to the point that using a struct might make more sense in that case.
The better option for an array is to declare it in the .data subsection and then its stored out in main memory. (Because MIPS is a simulator not a native language we are still constrained on array sizes compared to C, but that constraint is on the order of a billion elements).
Change the array to 5 elements (you need to change the .space parameter to something > 12)
You then need to load up those elements into the array
And then print off all of the elements in the array.
image text in transcribed
data theArray: epsce 12 apace an int is bysoso 3 gorsis 2 bys -text 5 fchis fixst bit just puts valuss into rogistors 6 arcer thie ve need to copy them to an array addi sel, seo 3 addi $s2, zero, 5 know wo need to ute aw totoro word) to move values into 4n array set the index addl Sto, S2e, 0 Scoas 10 12 13 14 15 16 17 18 19 20 21 50, theArray(sto addi to, Sto. addi t 9t0. 582, theArray(sto) add to, sto, 4 #2oading data (to print it) lw ,print thaArray($zero) t 6, 23 24 25 26 27 28 syscall done li Svo 10 ayacall1

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 Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions