1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
makvit [3.9K]
3 years ago
10

Assume that k corresponds to register $s0, n corresponds to register $s2 and the base of the array v is in $s1. What is the MIPS

assembly code corresponding to this C segment
Computers and Technology
1 answer:
BlackZzzverrR [31]3 years ago
4 0

Answer:

hello your question lacks the C segment so here is the C segment

while ( k<n )

{v[k] = v[k+1];

     k = k+1; }

Answer : while:

   bge $s0, $s2, end   # while (k < n)

   addi $t0, $s0, 1    # $t0 = k+1

   sll $t0, $t0, 2     # making k+1 indexable

   add $t0, $t0, $s1   # $t0 = &v[k+1]

   lw $t0, 0($t0)      # $t0 = v[k+1]

   sll $t1, $s0, 2     # making k indexable

   add $t1, $t1, $s1   # $t1 = &v[k]

   sw $t0, 0($t1)      # v[k] = v[k+1]

   addi $s0, $s0, 1

   j while

end:

Explanation:

The MIPS assembly code corresponding to the C segment is

while:

   bge $s0, $s2, end   # while (k < n)

   addi $t0, $s0, 1    # $t0 = k+1

   sll $t0, $t0, 2     # making k+1 indexable

   add $t0, $t0, $s1   # $t0 = &v[k+1]

   lw $t0, 0($t0)      # $t0 = v[k+1]

   sll $t1, $s0, 2     # making k indexable

   add $t1, $t1, $s1   # $t1 = &v[k]

   sw $t0, 0($t1)      # v[k] = v[k+1]

   addi $s0, $s0, 1

   j while

end:

You might be interested in
What Will Social Media Look Like in the Future?
Nutka1998 [239]

Answer: Social Media has come long way from just being a platform for interaction to necessity entity. In today's era social media plays a vital part and it can be stated that it'll continue to have the same effect in the future. From being a platform for business organizations to endorse their product and services to a wider audience, to being a platform for an individual to connect to his/her friend and family that live all the way on the other end of the world.

There are several possibilities that Social Media can unlock in the possible future.

3 0
4 years ago
Who wants to become friends
Korolek [52]

Answer:

Sure why not

Explanation:

7 0
3 years ago
Why is it now difficult for computer technology to maintain the pace of
KatRina [158]

It now difficult for computer technology as manufacturing cannot keep up with overwhelming transistor demand.

<h3>What was Moore's Law ?</h3>

Moore's Law is the one that talks about the fact that the number of transistors on a microchip is one that often goes up about two years always, even if the cost of computers is reduced.

Based on the above, It now difficult for computer technology as manufacturing cannot keep up with overwhelming transistor demand.

Learn more about computer technology  from

brainly.com/question/24912812

#SPJ1

6 0
2 years ago
How do you access the dark web
Artist 52 [7]

Answer:

look up dark web links

Explanation:

8 0
4 years ago
Read 2 more answers
What could be the reasons behind developing programming languages? What are the advantages of planning your code before attempti
riadik2000 [5.3K]

Answer:

So the first reason why there's a lot of languages is because people keep creating them, even when they don't really need to. Another reason is because some languages are much better suited to certain tasks than others. Some programming languages are also much easier to learn than others.

For example:

C# <em>is good for Game development</em>

Javascript <em>is good Website Development</em>

Python <em>for developing desktop GUI applications, websites and web applications</em>

Thank You 8)    

<em><u>MARK AS BRAINLIEST IF YOU ARE SATISFIED :- ) </u></em>

8 0
4 years ago
Other questions:
  • Initialize the list short_names with strings 'Gus', 'Bob', and 'Zoe'. Sample output for the givenprogram:Gus Bob Zoeshort_names
    13·1 answer
  • 12.
    10·1 answer
  • Which equation gives you the amount of work performed?
    13·1 answer
  • Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
    5·1 answer
  • What is an LMS and how is it used?
    8·1 answer
  • If Nancy receives an encrypted message from Matthew, which key does she use to read it? Nancy’s private key Nancy’s public key M
    8·1 answer
  • Dusk is considered “a magic hour” by photographers and is the time when light is the least harsh. True or false.
    12·2 answers
  • What is the possible output from system.out.println((int)math.random() * 4)?
    8·1 answer
  • What is the value of the variable answer after the following code is executed?
    10·1 answer
  • What does the following code print? time_of_day = ["morning", "afternoon", "evening"] for word in time_of_day: print "Good " + w
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!