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
The Internet began when a large company wanted to sell products online
aalyn [17]
No!The internet began in the 1950s when the US government was trying to use connected computers to compete with the Soviet Union's Sputnik. Hope this helps :)
6 0
3 years ago
Plz help asapppll !!!!!!!
Zepler [3.9K]

Answer:

couldnt tell yah sorry

Explanation:

8 0
3 years ago
What does the minimum password age setting control?
Dmitrij [34]
13? 13 is most minimum ages however, I don't understand this question all that well.
3 0
3 years ago
What is the contents of the vector names after the following statements? vector names; names.push_back(“Ann”); names.push_back(“
Stolb23 [73]

Answer:

ann, cal

Explanation:

3 0
3 years ago
A knowledge of which of the following area-of-study combinations would give an HCT professional the best background? anthropolog
Helga [31]
Cognitive Science and Graphic Design.

HCT which stands for Home and Community Based Treatment is a home based behavioral home based health service for families and youth that require a more advanced treatment plan besides the outpatient therapy. HCT’s are trained in a number of treatment modalities like Cognitive behavioral therapy and trauma focused cognitive behavioral therapy. Arts creativity is one aspect that is required in such kinds of therapy and thus a background in graphic design is required.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Describe the "Mister Splashy Pants" campaign. How did it start? What happened?
    7·2 answers
  • Need help ppplllleeeassse<br><br> Hhheeelllppp
    15·2 answers
  • Which of the following sentences is correct?a. Arithmetic log unit is used to perform both integer and floating point computatio
    8·1 answer
  • The greatest predictor of home Internet use is _____. income location race training
    5·2 answers
  • 2. 5s is a Chinese principle adapted for use in the workplace.<br>True or False​
    11·1 answer
  • Is EXE is the extension of MS Excel file.<br> subject: ICT for GR 5
    10·1 answer
  • New friends??? if you want to be my new friend go follow my gram
    7·2 answers
  • 2. Media sharing websites let you post photos and videos to share with other people. What are the benefits and drawbacks of usin
    10·1 answer
  • What security setting can cause a mobile device to erase installed apps and data if the passcode is incorrectly entered a number
    11·1 answer
  • the function must find the substrings of s that start with a vowel and end with a consonant, then print the alphabetically first
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!