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
Yuki888 [10]
2 years ago
14

convert the following c code to mips. assume the address of base array is associated with $s0, n is associated with $s1, positio

n is associated with $t0, c is associated with $t1, d is associated with $t2, and swap is associated with $t3 for (c
Computers and Technology
1 answer:
Brums [2.3K]2 years ago
7 0

Answer:

Explanation:

hello we will follow a step by step process for this code, i hope you find it easy.

Mips Equivalent code:

  sw      $0,0($fp)

.L7:

       lw      $2,12($fp)

       addiu   $2,$2,-1

       lw      $3,0($fp)

       slt     $2,$3,$2

       beq     $2,$0,.L2

       nop

       lw      $2,0($fp)

       sw      $2,8($fp)

       lw      $2,0($fp)

       addiu   $2,$2,1

       sw      $2,4($fp)

.L5:

       lw      $3,4($fp)

       lw      $2,12($fp)

       slt     $2,$3,$2

       beq     $2,$0,.L3

       nop

       lw      $2,8($fp)

       dsll    $2,$2,2

       daddu   $2,$fp,$2

       lw      $3,24($2)

       lw      $2,4($fp)

       dsll    $2,$2,2

       daddu   $2,$fp,$2

       lw      $2,24($2)

       slt     $2,$2,$3

       beq     $2,$0,.L4

       nop

       lw      $2,4($fp)

       sw      $2,8($fp)

.L4:

       lw      $2,4($fp)

       addiu   $2,$2,1

       sw      $2,4($fp)

       b       .L5

       nop

.L3:

       lw      $3,8($fp)

       lw      $2,0($fp)

       beq     $3,$2,.L6

       nop

       lw      $2,0($fp)

       dsll    $2,$2,2

       daddu   $2,$fp,$2

       lw      $2,24($2)

       sw      $2,16($fp)

       lw      $2,8($fp)

       dsll    $2,$2,2

       daddu   $2,$fp,$2

       lw      $3,24($2)

       lw      $2,0($fp)

       dsll    $2,$2,2

       daddu   $2,$fp,$2

       sw      $3,24($2)

       lw      $2,8($fp)

       dsll    $2,$2,2

       daddu   $2,$fp,$2

       lw      $3,16($fp)

       sw      $3,24($2)

.L6:

    lw      $2,0($fp)

       addiu   $2,$2,1

       sw      $2,0($fp)

       b       .L7

        nop

cheers  i hope this helps

You might be interested in
Some smartphones use ______ text, where you press one key on the keyboard or keypad for each letter in a word, and software on t
Oksanka [162]

Answer:

The answer is "predictive".

Explanation:

The statement lacks some details, which can be answered by the choice of the question:

A. Presumptive .

B. suggestive .

C. interpretive.

D. predictive.

Predictive text is considered to be auto-correct text as well. It is an input technique, which allows people to type words onto a smartphone throughout the text field. It's focused on both the significance of the words and letters in the message, and certain choices were wrong, which can be defined as follows:

  • Option B and Option D both were wrong because it provides the synonyms of the words.
  • In option C It is wrong because it is a text version.

5 0
3 years ago
Write the simplest statement that prints the following on a single line: 3 2 1 Go! Note: Whitespace (blank spaces / blank lines)
Olin [163]

Answer:

//here is the statement in java.

import java.util.*;

//class definition

class Solution

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // this statement will print the 3 2 1 Go! and go to newline

       System.out.println("3 2 1 Go!");

   }catch(Exception ex){

       return;}

}

}

Explanation:

We can use "System.out.println()" to print the required output same as it required. After printing this, it will go to newline.

Output:

3 2 1 Go!

4 0
2 years ago
What type of application would be appropriate for learning a foreign language?
Marysya12 [62]

Answer:

Education

Explanation:

Most apps for <u>learning</u> a new language are for educational purposes and are most likely an education type of app.

7 0
2 years ago
Read 2 more answers
To check spelling errors in a document, the Word application uses the _____ to determine appropriate spelling. Internet built-in
Ilya [14]

The answer is built-in dictionary.

Most Microsoft Word versions come with a built-in dictionary for standard grammar and spellings. These dictionaries are not comprehensive. Word also has an additional option to add a spelling error to the dictionary so that the next time you type that same error, it will not come up as a spelling error. In addition, Word can use multiple custom dictionaries that allows you to supplement with the main dictionary and check the spelling of your documents.

6 0
2 years ago
Read 2 more answers
in triangle abc the value of cot a by 2 into cot B by 2 minus 1 whole divided by cot a by 2 into cot B by 2 is equal to​
netineya [11]

Answer: 2 + 2 is 4 minus 1 thats 3 quick mafs

Explanation:

8 0
3 years ago
Other questions:
  • Molly wants to make some cells in her balance spreadsheet different colors so that she can more quickly find important data. Wha
    13·2 answers
  • Create an instance of your queue that accepts java.lang.String Objects. Starting with an empty queue, use the enqueue(E e) metho
    15·1 answer
  • Variables set equal to patterns are said to be:_______.
    7·1 answer
  • Many software makers provide free downloadable updates, sometimes called a(n) ______ to users who have registered and/or activat
    5·1 answer
  • You have just changed the system time within your computer's BIOS. You choose to save the settings upon exit. What happens next
    14·2 answers
  • Why does brainly keep saying “oops... something went wrong! Try again”
    7·2 answers
  • Create a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop shou
    5·1 answer
  • Whats important about the points?
    10·2 answers
  • Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grade
    10·1 answer
  • What is the positional weigh of the digit 7 in the octal number 7642 ?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!