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
What is the name of the file in which this
anyanavicka [17]

Answer:

B

Explanation:

i’m an information technology  student and as I remember we used this  name

3 0
3 years ago
An investigator obtains consent and HIPAA authorization from subjects to review their medical records and HIV status. He plans t
matrenka [14]

Answer:D. A HIPAA violation

Explanation:

The Health Insurance Portability and Accountability Act of 1996 is a legislation that was designed to protect or safeguard medical records of patients, to eliminate and prevent healthcare fraud and protect health care coverage of employees .

It helps to ensure that patients' information remains private and their record are secured.

The updated rules of this act includes the HIPAA Privacy Rule, HIPAA Security Rule, HIPAA Omnibus Rule, and the HIPAA Breach Notification Rule.

A HIPAA violation is a failure to comply with any aspect of HIPAA standards and provisions and in this case it was theft of records; he should have ensured that the computer is placed in a secured place or the information is locked even when the computer get stolen.

7 0
3 years ago
Find a quote that you like. Store the quote in a variable, with an appropriate introduction such as "Ken Thompson once said, 'On
pishuonlain [190]

Answer:

The program to this question as follows:

Program:

quote="You can always edit a bad page. You can’t edit a blank page."

name="Jodi Picoult"

print("Quote:\n",quote)

print ('\t\t\t\t\t\t\t',"Author name-", name)

Output:

Quote:

You can always edit a bad page. You can’t edit a blank page.

       Author name- Jodi Picoult

Explanation:

In the above python code, two variable "quote and name" is defined, in which variable both variable holds some string value.

  • In the next line, the print function is defined, that first print "Quote" as a message, and for line breaking "\n" is used, then print quote variable value.
  • In the last step, first, we use "\t" for line spacing then message "Author name-", and then name variable value.
7 0
3 years ago
The primary objective of database design is what?
professor190 [17]

Answer:

D)

Explanation:

4 0
3 years ago
Internet __________, or IP, describes how data pachets move through a network.
Lena [83]

Answer:

Packets

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is the command to create a compressed archive(archive1.tar.gz) of files test1 test2and test3.
    5·1 answer
  • True or false? The History list shows only Web pages you visited during the current computing session. -computer essentials
    7·1 answer
  • 15 points. Please give an actual answer and not some random thing. this is not just free points. Correct answer will receive bra
    12·2 answers
  • 01110100 01101000 01101001 01110011 00100000 01110011 01110101 01100011 01101011 01110011 00100000 01100010 01100001 01101100 01
    12·2 answers
  • Plz subscribe my yt gaming channel <br>FIREAZZ GAMING​
    8·2 answers
  • Viết chương trình hoàn chỉnh các yêu cầu sau:
    8·1 answer
  • How is primary storage different from secondary storage? Select the TWO correct statements. The CPU can only read and write data
    12·2 answers
  • Name any three areas of of application of excel.
    12·1 answer
  • Use the following flowchart to implement a simple application that will help students decide whether computer science is a good
    14·1 answer
  • The current annual interest rate is 5 percent, and you are taking out a 20-year loan with a monthly end-of-month payment. If you
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!