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
Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Everyti
Gemiola [76]

Answer:

b. cart total + 1

Explanation:

A. cart total=1 do increment the total with every 1 click here, it only 're-assigns cart total with value 1 for every click, hence it's always 1.

B. In every click, 1 is always added to the previous value of cart total, like addItemButton(cart total+1) or so.

C. This would have worked too if "cart total" and "cartTotal" where of same type.

D. cart total is just being initially defined here.

E. Likewise here, var shows that cart total has just only been declared.

6 0
3 years ago
John has had a message pop-up on his computer asking him to pay $800 to have his files
faltersainse [42]

• Installed a program containing ransomware/malware. (Do not accept downloaded without inferring it was installed)

• Opened an email attachment containing malware.

• Opened a file containing a malicious macro.

• Left his computer unsecure allowing someone else to install malware on it. (Should include an example, e.g. not logging off)

3 0
3 years ago
Read 2 more answers
Summarize the role of technology in efforts to explore space.
Georgia [21]
The role of technology in efforts to explore space could be argued to say that it has helped us to discover many different planets. An IS is a space station that helps us do stuff!!
6 0
3 years ago
David was editing his audio recording in his audio editing software. He adjusted the vocal track of his audio toward
Dmitrij [34]

Answer:

b

Explanation:

balancing the sound

a                h    o

l                 e    u

a                      n

n                      d

c

i

n

g

6 0
2 years ago
You live "out in the middle of nowhere" and feel there is no need to protect your internet connection because there is no one th
dlinn [17]
Yes, it put you at risk, and could have actually gotten you killed.
4 0
3 years ago
Other questions:
  • When your Windows XP file becomes too large to fit in a single window, which of these components allows you to bring different p
    6·1 answer
  • Jax needs to write a block of code that will organize a list of items alphabetically. Which function should he use? append() pri
    12·1 answer
  • Sending a busy manager a long email represents a problem in which area of the communication process
    7·1 answer
  • Write a program that generates two 3x3 matrices, A and B, withrandom values in the range [1, 100] and calculates the expression½
    11·1 answer
  • What is the relationship between a method and a function
    11·2 answers
  • The color pattern in which marine organisms are light on the bottom and dark on the top of their bodies camouflaging them agains
    11·1 answer
  • Which is a benefit of using the paste link option?
    15·2 answers
  • The new tag in HTML 5 means that it explanation or pronunciation of characters for Asian typography O sets a container for an ex
    12·1 answer
  • Draw a flowchart diagram for a program that displays numbers 1 to 20
    12·1 answer
  • Pleasee help meeeeeeeeee I’m stuckk!!!!
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!