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
PLEASE DON'T DELETE THIS QUESTION!!!!
USPshnik [31]

you can only have one picture on here ¿¿¿¿¿¿¿¿¿¿¿¿¿

3 0
4 years ago
Read 2 more answers
A file ____ shows the location of a file or folder
UkoKoshka [18]

Answer:

Path

Explanation:

correct answer: Path

(Hope this helps can I pls have brainlist (crown)☺️)

6 0
2 years ago
Newt Corporation, headquartered in Los Angeles, is a nationwide provider of educational services to post-graduate students. Due
zysi [14]

Answer:

Option B i.e., Circuit level gateways only enable data to be inserted into a network which is the product of system requests within the network.

Explanation:

In the above question, some details are missing in the question that is options.

Option B is valid because Circuit level gateways are not the transmission inspection, always require information into such a server resulting through system appeal inside the server through maintaining a record for connections that are sent into the server and only enabling information in this is in answer to such queries.

Other options are incorrect because they are not true according to the following scenario.

5 0
4 years ago
Write one line of code to print animals, an array of Animal objects.
oksian1 [2.3K]

Answer:

console.log(Animal);

Explanation:

The statement written above prints the array Animal which contains objects.There are two to three ways to print the array Animal in javascript. One of the method is written in the answer it prints the arrays in the console of the browser.

You can go to the console by pressing F12 and then clicking on the console.

Other methods to print are

  1. Simple write Animal after defining the array.
  2. Use alert.
  3. document.write()
7 0
3 years ago
What are the three major functions of a game engine?
zzz [600]
Three major functions of a game engine would be Physics, Programming, and an audio engine should be some major functions of a game engine.
4 0
3 years ago
Other questions:
  • Bit rate is a measure of how many bits of data are transmitted per second. Compared to videos with a higher bit rate, the same v
    13·1 answer
  • Approximately, what percentage of Smartphone owners in America uses their mobile devices to access social media platforms?
    7·1 answer
  • You are a disgruntled employee with a master’s degree in computer sciences who was recently laid off from a major technology com
    11·1 answer
  • An application needs to calculate sales tax for purchases. You decide to simplify the code by putting the sales tax calculation
    9·1 answer
  • Write a function that will alphabetize a string WITHOUT using the sort function :
    7·1 answer
  • Someone once observed that "the difference between roles and groups is that a user can shift into and out of roles, whereas that
    13·1 answer
  • A(n) ________ moves over the spinning platters to retrieve data from the hard disk.
    6·1 answer
  • Imagine that you wanted to write a program that asks the user to enter in 5 grade values. The user may or may not enter valid gr
    10·1 answer
  • What is pollution?
    14·2 answers
  • Figure out what this says:<br><br> ?driew tib a kool ti seoD
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!