Question

In MIPS, I am trying to create an array of 7 words that can either be...

In MIPS, I am trying to create an array of 7 words that can either be hard coded or entered from the user. I have been unable to find a helpful tutorial on this. An answer with an explanation would be much appreciated.

Homework Answers

Answer #1

   .data
list:    .word 6,11,13,17,40,45,70
size:   .word 7

THIS IS THE ARRAY OF SIZE 7 in MISP THE DATA IS HARDCODED SO THAT YOU CAN EASILY UNDERSTAND THE STRUCTURE INPUTTING IN THE ARRAY MAY BE A LITTLE DIFFICULT FOR YOU AT THIS TIME AS YOU ARE NEW TO ARRAY

la $t3, list # we are placing the list address into $t3
li $t2, 6 # now we are placing the sixth index of our list in $t2
add $t2, $t2, $t2
add $t2, $t2, $t2
add $t1, $t2, $t3

# the above code is increasing array cell first two lines are making it four times bigger and then we are combining our data from $t2 and $t3
lw $t4, 0($t1)    # getting value from array cell

THE ABOVE INSTRUCTIONS ARE USED FOR ACCESSING THE ARRAY DATA FOR INSTANCE

IF YOU HAVE ANY QUERY PLEASE COMMENT DOWN BELOW

PLEASE GIVE A THUMBS UP

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
for C++, I am trying to create a function that prints a 2D array. Can you...
for C++, I am trying to create a function that prints a 2D array. Can you instruct me on the easiest way to do so? Please do not make it complicated, we have no started learning about pointers yet, either, so it can't be done that way.
First issue: a) I am trying to create a SQL query so i can list all...
First issue: a) I am trying to create a SQL query so i can list all the items that a user has bought b)I am trying to show how much it will cost in total for user My tables: Table user(user_id, username, shipping_address) Table item(item_id, item, pricing) Table receipt(r_id, user_id, date_current) Table rDetailing(r_id, item_id, item_in, amount_of_item)
Good day, I am trying to create a PICO question research question. Can you please give...
Good day, I am trying to create a PICO question research question. Can you please give me some examples that i can use? I am interested in newborn babies. Maybe something with home births vs hospital birth or water birth vs traditional birth and an increase in death with babies? I am not sure. Please help. Tell me what you want to find out/ what is your purpose of the research question.
I am trying to use solver in excel to find the max sharpe ratio for a...
I am trying to use solver in excel to find the max sharpe ratio for a portfolio of 5 stocks. I need to somehow set a constraint where the weights of all five stocks still add up to 1. How would I set a constraint of this nature? I have been unable to enter weight1+weight2+weight3+weight4+weight5=1. Is there a way to do this? or another solution.
Good day, I am trying to create a PICO question research question. Can you please give...
Good day, I am trying to create a PICO question research question. Can you please give me some examples that i can use? I am interested in newborn babies. Maybe something with home births vs hospital birth and an increase in death with babies? I am not sure. Please help.
I am having a hard time trying to understand how to to create a truth table....
I am having a hard time trying to understand how to to create a truth table. It would help if you could also explain what you did too. Thank you in advance. 1) Construct a truth table for the following: a) f(x,y)= xy+xy’         b) f(x,y,z)= x'yz' + x'yz + xy'z' + xyz' + xyz
NO POINTERS TO BE USED. This is C programming. I am trying to make a function...
NO POINTERS TO BE USED. This is C programming. I am trying to make a function to calculate standard deviation from a hard coded array. Why is my function not returning my stddev value back to main? I keep getting an error saying that stddev is undeclared. #include <stdio.h> #include <math.h> float calcstddev(float examgrades[], int size) {    float sum =0.0;    float mean;    int temp;    float variance;    float stddev;    float difference;    for (temp=0;temp<size;++temp)   ...
Hello, I am trying to create a java script code that can arranges the input lowest,...
Hello, I am trying to create a java script code that can arranges the input lowest, highest, finding average, sort them and the clear form functionality. I managed to create the code that sorts the number input from lowest to highest but I am stuck on the rest. See the code below Please help. <!DOCTYPE> <html> <head> <title>EXAM01_01</title> <style type="text/css"> form{color:black;background-color:lightgray;border:6px solid black;border-width:4px;width:450px;margin:1px;padding:1px;} #ans1,#ans2,#ans3,#ans4,#numbers{background-color:white;border:4px solid black;} input[type="button"]{color:black;background-color:red;border:4px solid black;} input[type="text"]{margin:2px;} div.title{color:white;background-color:black;float: left; width: 450px; text-align:center;} </style> <script>    function readNumbers()...
Create a function in MIPS using MARS to determine whether a user input string is a...
Create a function in MIPS using MARS to determine whether a user input string is a palindrome or not. Assume that the function is not part of the same program that is calling it. This means it would not have access to your .data segment in the function, so you need to send and receive information from the function itself. The program should be as simple as possible while still using necessary procedures. Follow the instructions below carefully. Instructions: ●...
I am having some trouble trying to create a linked list from a text file input...
I am having some trouble trying to create a linked list from a text file input from user The three lines respectively represent a long integer ID of a person, the name of the person, and an integer ranging from 0 to 5 indicating the threat level posed by a person. 389114 Paul Bunion 5 399012 John Doe 0 685015 Johnny Appleseed 3 179318 Tom Sawyer 2 284139 Ebenezer Scrooge 5 The full connection is: Paul Bunion -> John Doe...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT