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
Program Convert Measurements:
worty [1.4K]

on the truth is that the walls

6 0
3 years ago
_____ is the software that protects you computer from harmful files, Trojan horses, and worms.
Bumek [7]
I think it's antivirus because Antivirus means to protect your computer from a deadly virus
4 0
4 years ago
Read 2 more answers
almost every school or university has a or council or organization that works towards provision of providing education training
disa [49]

Answer:

In education, the term stakeholder typically refers to anyone who is invested in the welfare and success of a school and its students, including administrators, teachers, staff members, students, parents, families, community members, local business leaders, and elected officials such as school board members, city ...

Explanation:

6 0
3 years ago
Jim has downloaded, installed, and is running too many programs simultaneously. At what pace will his computer be performing?
miss Akunina [59]

Answer:

Jim's computer will be performing at a slow pace

Explanation:

When you have too many programs open in the background, they eat up your cpu and core memory, causing your PC to lag. Jim's computer is likely to experience lag if he's running a bunch of programs at the same time.

6 0
3 years ago
Which are two common methods a laptop uses to get an Internet connection over a cellular network?
Vikentia [17]
Wi-Fi or Tethering.
8 0
3 years ago
Other questions:
  • An example of live footage is when?
    10·2 answers
  • Which of the following is NOT true about high-level programming<br> languages?
    9·2 answers
  • True or false? LearnSmart (the "smart flash card assignments") really gets your competitive spirit in gear by allowing you to se
    8·1 answer
  • A date consists of a month, day, and year. Consider the class Date of such dates. Suppose that Date represents the month, day, a
    14·1 answer
  • Taking notes on a customer complaint is a form of a communication<br> TRUE OR FLASE
    10·1 answer
  • Select the tasks that would be performed by an information systems graduate.
    9·1 answer
  • How is modern technology developed? Explain.
    14·2 answers
  • Explain one rule the company must follow when using cookies on its website.
    13·1 answer
  • What is known as the global network of computers?
    9·2 answers
  • Which of the following was the first computer-animated film to win animated film to win an academy award?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!