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]
3 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]3 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
An initialization expression may be omitted from the for loop if no initialization is required.
stealth61 [152]

Answer:

True

Explanation:

for loop is used to repeat the process again and again until the condition not failed.

syntax:

for(initialize; condition; increment/decrement)

{

    Statement

}

But we can omit the initialize or condition or increment/decrement as well

the syntax after omit the initialization,

for( ; condition; increment/decrement)

{

    Statement

}

The above for loop is valid, it has no error.

Note: don't remove the semicolon.

You can omit the condition and  increment/decrement.

and place the semicolon as it is. If you remove the semicolon, then the compiler show syntax error.

5 0
3 years ago
What are examples of intermediate goals that require funding? Check all that apply.
SashulF [63]
2.) Attending college
3 0
3 years ago
Read 2 more answers
100 POINTS + BRAINLYEST FOR FIRST PERSON THAT GETS IT RIGHT!!!! While writing a formula, what are some ways to insert a cell ref
nexus9112 [7]

Answer:

Line second and third i.e, "typing the cell name, like "B4"  and clicking the cell to reference " the correct answer.

Explanation:

It relates to some kind of set of cells on the worksheet, which could be used to calculates the formula. It also helps to locate the information, which you want to analyze in the calculation. It can also provide the cell reference in  more than one formula in the same worksheet, that relates to Information on many other workbooks, and wrong choices can be described as follows:

  • Hovering provides the basic details, in which we hover, that's why it is wrong .
  • Zooming is used in projection, it can't be used in the cell reference, that's why it is wrong.
7 0
3 years ago
Read 2 more answers
Distinguish between the desktop publishing packages and multimedia packages​
maksim [4K]

Answer:

___________________________________________________________

Word processing software is used for working with text, while desktop publishing software involves production of documents that combine text with graphics. DTP software is perfect for making flyers, brochures, booklets. This type of software is usually more advanced than word processing apps.

___________________________________________________________

4 0
3 years ago
Are there different types of machine language?
7nadin3 [17]
No machine language have no any type
7 0
3 years ago
Read 2 more answers
Other questions:
  • Data mining is defined as: a)Separating data and programs such that each can be changed without changing the other b)Allowing ma
    5·1 answer
  • 3. If the typical balance on Lucy's credit card is $750 and the interest rate (APR) on her credit card is 16%, how much in inter
    11·2 answers
  • Which if the following ribbons in Microsoft word is used to add tables and images
    14·1 answer
  • Select the correct answer.
    12·2 answers
  • Which spreadsheet feature could the scholarship committee use to locate applicants who meet the criteria?
    10·1 answer
  • Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
    11·1 answer
  • What is white light?
    12·2 answers
  • Helppppppppppppppp me please Can i have help for a ggogle class room
    5·1 answer
  • You have been asked to analyze the Excel data provided by your IT department. You would like to have the ability to sort and fil
    10·1 answer
  • Which one of these are a valid IPv4 address?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!