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
xz_007 [3.2K]
3 years ago
8

Given a high-level code you should be able to write the corresponding MIPS assembly code. Simple loop in C; A[ ] is an array of

ints do { g = g + A[i]; i = i + j; while (i != h) } Rewrite this as: Loop: g = g + A[i]; i = i + j; if (i != h) goto Loop; Using the mapping: g: $s1, h: $s2, i: $s3, j: $s4, base of A: $s5; write the corresponding assembly instructions
Computers and Technology
1 answer:
nevsk [136]3 years ago
4 0

Answer:

Explanation:

The code for the given problem is written below

.data

A : .word 1 2 3 4 5 6 7 8 9 10

.text

la $s5,A

li $s1,0 # load g

li $s2,10 # load h

li $s3,0 # load i

li $s4,1 # load j

loop:

mul $s6,$s3,4

add $s6,$s6,$s5 #address of A[i]

lw $s6,($s6) #get value of A[i] in s3

add $s1,$s1,$s6 #g = g+A[i]

add $s3,$s3,$s4 # i = i+j

bne $s3,$s2,loop #if i!=h jump to loop

You might be interested in
In Outlook 2016, what are the three format options when sending an email message? Check all that apply.
tankabanditka [31]
Plain text, HTML, and rich text.
4 0
3 years ago
What is bespoke software???​
denis-greek [22]

Answer:

custom-built to address the specific requirements of a business

Explanation:

5 0
3 years ago
Read 2 more answers
Susan wants to play the games that come with Windows on her computer, but they are not on the Start menu. What should she do in
ollegr [7]

Answer:

Search for the games in the search bar

Explanation:

5 0
2 years ago
The theory of continental drift suggests that at one time,
MakcuM [25]
The Continents were all joined into one land mass
3 0
3 years ago
Read 2 more answers
How do you know if someone read your message on messenger?
kherson [118]
It would say that the person read the message on the picture of the person. Example if you texted your friend at 7.00 and it said that the person read at 7.15. got it now?
3 0
3 years ago
Other questions:
  • The title bar of a window tells you the name of the document or program that's being displayed in the window, and it also serves
    11·1 answer
  • Write a method that take an integer array as a parameter and returns the sum of positive odd numbers and sum of positive even nu
    13·1 answer
  • What task does the casting director do, apart from auditioning actors?
    8·1 answer
  • If you notice files being transferred to or from your computer a. Simply close the window c. Tell the lab instructor b. Open a n
    11·2 answers
  • Green field country is planning to conduct a cricket match between two teams A and B. a large crowd is expected in the stadium a
    6·1 answer
  • Which of the following instructions should be allowed only in kernel mode? (a) Disable all interrupts. (b) Read the time-of-day
    11·1 answer
  • Your dad just gave you his old computer running Windows 7. You want to see how many volumes are contained within it. Which tool
    10·1 answer
  • What are the parts of a file?​
    9·1 answer
  • In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
    10·1 answer
  • Describe the specific job you would want to have if you were going to pursue a career in digital music or video.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!