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
Analyze the following code.
vazorg [7]

Answer:

The correct answer for the given question is "The program has a runtime NullPointerException because test is null while executing test.x"

Explanation:

In this code their is run time exception will occur in Main method i.e "java.lang.NullPointerException "because the object of the Test class i.e test will initialized by "null" .So on executing the statement test.x  it gives an Runtime Exception.The "NullPointerException" can occur if we assign the object to the "null" value that why it produce an java.lang.NullPointerException

8 0
3 years ago
Which retouching action is unethical?
e-lub [12.9K]

Answer:

B.) removing the saturation in a photograph intended as a magazine cover page

7 0
3 years ago
Why can i go to discord if my school blocks it-
finlep [7]

Answer:

They didn't do it right.

Explanation:

5 0
3 years ago
Fill in the blank. The process that a wireless router uses to translate a private IP address on internal traffic to a routable a
AleksandrR [38]

Answer:

Network Address Translation (NAT)

Explanation:

With the aid of Network address translation(NAT), the IP addresses of a particular local network are translated or mapped into a single or multiple global or public IP addresses. Therefore, a wireless router could use NAT to translate its private IP address on internal traffic (network) to a routable address for the internet.

With NAT, businesses can use many internal IP addresses since they are just for internal purposes and will be eventually converted into a single or a few multiple routable IP addresses.

Three types of NAT are possible:

(i) Static NAT : There is a one - to - one mapping between private IP addresses and routable (public) IP addresses. One private IP is mapped to one public IP address.

(ii) Dynamic NAT : There is a many- to - many mapping between private IP addresses and routable (public) IP addresses. Multiple private IPs are mapped to many public IP addresses.

(iii) Port Address Translation (PAT) : Many - to - one relationship between the private IP addresses and public addresses. Many private IP addresses can be mapped or translated into a single public IP address. This type of NAT is also called NAT overload.

6 0
3 years ago
Terry is building a Web site and wants to have three main links called Home, Product Info, and Contact Us. She will create a hie
Shalnov [3]

Answer: Child element

Explanation:

 According to the question, terry building the web site and she wants to create the three main types of links in the home page such as home, contact us and the product information. The, she start creating the hierarchy of elements in the page and also revise all the styles in the sheet.

Then, the home page contain the two child element as it s the sub elements of the home page. As, the one element which is inherited from the upper element ( Parent ) is known as child element. This is the hierarchy of the elements which represented in the home page.  

5 0
3 years ago
Other questions:
  • Stella likes to work with colors and moving pictures. She is good at drawing. Which job role should she choose
    11·2 answers
  • Which of the following statements is not true of web storage?
    13·1 answer
  • What is the Default path for SYSVOL?
    14·1 answer
  • A researcher plans to identify each participant in a certain medical experiment with a code consisting of either a single letter
    10·1 answer
  • A browser allows you to set preferences for using the browser. These preferences include all of the following except
    7·1 answer
  • Select the correct answer.
    15·2 answers
  • Who benefits from digital technology?
    15·1 answer
  • How do I create a simple percentage function to gather a score for a quiz in PHP?
    14·1 answer
  • Can anyone please help me out
    10·1 answer
  • How to do or create a shepard tone using additive synthesis in Pure Data. Please help, desperate!!
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!