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
How is your mental health as you're returning to school virtually or in
kupik [55]

Answer:

My Answer is Below.

Explanation:

I have been experiencing stress, anxiety, fear, sadness and loneliness. And mental health disorders, including anxiety and depression, slowing it's going away once I get to talk to my friends and get to interact with others. Even though I get lots of anxiety from talking in public. I actually feel all of those hopefuls, exhausted, overwhelmed and more, because it's hard at home especially when my mom is really sick with brain cancer, since she was 12 yrs old now 40 yrs old. It's a lot to take in but I'm still trying.

Hopes this Helps :D

5 0
3 years ago
If you want to distribute a formatted Microsoft word document to people who don't have word save it as a __file
Helga [31]
If you want them only to read it and not change it send as a .pdf else I would send as a .txt file. Hope that helps
5 0
3 years ago
Help with this pleaseeeeeee​
slavikrds [6]

Answer:

fiber optic because It is thinner than the others in the list

8 0
3 years ago
Some request lists might cause the disk scheduler to act the same when the three different algorithms are run. Create a request
storchak [24]

Answer:

35, 25, 50, 75, 95

Explanation:

List of five track numbers that will cause all three algorithms to visit the same tracks in the same order are -

35

25

50

75

95

Please go to attachment for the diagram how these 5 tracks will be traversed by various algorithms.

All the algorithms traverse in the order 35 -> 25 -> 50 -> 75 -> 95

7 0
4 years ago
HELP ASAP!! WILL MARK BRAINLIEST
lesya692 [45]

Answer:20*i

Explanation:

Because the size will expand as its being written out to then have i

4 0
3 years ago
Other questions:
  • 14. Emelia is very concerned about safety and has conducted a study to determine how many bike helmets were replaced at each loc
    13·2 answers
  • Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
    7·1 answer
  • A collection of methods that can be used by any class, as long as the class provides a definition to override the collection's a
    5·1 answer
  • What is information technology?
    12·1 answer
  • In ____, data can move in both directions at the same time, such as with a telephone.
    11·1 answer
  • What is the purpose of a Primary Domain Controller?
    12·1 answer
  • Tulio is editing his video. He used the Trim Video tab. Tulio most likely changed the
    12·1 answer
  • Wake up to reality. Nothing ever goes as planned in this world. The longer you live,the more you realize that only pain, sufferi
    5·1 answer
  • The following Mic1 microcode excerpt shows support for a possible 7 bit opcode, 8 bit integer argument machine instruction (orga
    14·1 answer
  • Advantages and disadvantages of a watch tower​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!