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
Describe network in terms of the class computer lab
kobusy [5.1K]
<span>a group or system of interconnected people or things</span>
6 0
3 years ago
What does the third argument (3) refer to in the following formula: VLOOKUP(10005, A1:C6, 3, FALSE)
zzz [600]

Answer:

The answer is "number of the column containing the return value".

Explanation:

In Excel, the "VLOOKUP" method is used to perform the vertical search by looking for both the value during the user table and retrieving the number of the index number location in the same row. It is a built-in function, which is classified as a Lookup or Reference worksheet function, and the following function can be defined as follows:

  • In the 1st parameter, it is used to watch the value for the match.  
  • In the 2nd parameter, it is used to search the table.
  • In the 3rd parameter, it is used as the column number representing the return value.  
  • In the 4th parameter, it is used to return only if the same match is found.
5 0
3 years ago
Explain how the CPU processes data instructions.
Black_prince [1.1K]

Answer:

The actual mathematical operation for each instruction is performed by a combinational logic circuit within the CPU's processor known as the arithmetic logic unit or ALU.

Explanation:

6 0
3 years ago
Do you guys know if there's a way for me to find a Google doc that I typed but forgot to save if you do it for points i will rep
ValentinkaMS [17]

Answer:

Usually, Google Docs save automatically. If you remember some keywords that you typed, try searching for it. For example, if you typed up a report about dogs, search "dogs" when you're on the Google Docs home screen.

Explanation:

If this doesn't help, leave a comment and I'll try to help more!

4 0
3 years ago
Read 2 more answers
PowerPoint is great for brainstorming and producing creative pieces because it
leonid [27]
Your answer is most likely A. Use media
7 0
3 years ago
Read 2 more answers
Other questions:
  • Two electronics students are discussing static electricity and electric current. Student A says that a basic property of static
    12·1 answer
  • Ar count = 10;
    13·1 answer
  • Which hexadecimal-type address refers to a physical networking device such as a network interface card?
    10·1 answer
  • The words that follow a code number in the cpt manual are called the
    12·1 answer
  • your friend's parent's are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    11·1 answer
  • What is the difference between player-centric game design and designer-centric game design? How does a player-centric game assis
    7·1 answer
  • Which statement assigns the value 140 to the variable streetNumber in Python?
    13·1 answer
  • What feature is available to add a suggestion in the margin of someone else's document?​
    15·1 answer
  • Which item is developed last in the cyclical design process
    11·1 answer
  • a) consider the binary number 11010010. what is the base-4 representation of (11010010)2? (there is a way to do this without con
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!