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]
2 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]2 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
Which of the following is where you can save, select a template, change document properties, and close or exit excel?
Aneli [31]
It is the 'backstage' in which you can <span>save, select a template, change document properties, and close or exit excel</span>
5 0
3 years ago
Unwanted emails are called:malware,phishing, spam or virus
Colt1911 [192]
1. Spam
2. Phishing
3. True
3 0
3 years ago
What is a Web application?
OLga [1]

Answer:

A web application is a computer program that utilizes web browsers and web technology to perform tasks over the Internet.

Explanation:

Web applications include online forms, shopping carts, word processors, spreadsheets, video and photo editing, file conversion e.t.c.

7 0
3 years ago
A university wants to schedule the classrooms for final exams. The attributes are given below:
iVinArrow [24]

Answer:

See explaination

Explanation:

Clearly the entities are as follows:-

Course

Section

Room

Test

The relationship among entities are as follows:-

Course has Section

Test is conducted for Course

Test is conducted in Section

Test is conducted in Room

Attributes of each entities are as follows:-

Course (CourseID, Name, Department)

Section (SectionID, Enrollment)

Room (RoomNumber, Capacity, Building)

Test (Time)

Section is a week entity as, there may be same sections for different courses, therefore section uses the primary key of course entity as foreign key.

Also entity Test is dependent upon the entities Room,Section and Course, therefore primary keys of these entities will be used as foreign key in the Test entity.

Check attachment for the ER diagram

5 0
2 years ago
Explain cell reference and its types with examples?​
skad [1K]

Answer:

There are two types of cell references: relative and absolute. Relative and absolute references behave differently when copied and filled to other cells. Relative references change when a formula is copied to another cell. Absolute references, on the other hand, remain constant, no matter where they are copied.

8 0
2 years ago
Other questions:
  • 2. A body is thrown vertically<br>100 m/s Theme taken to retum​
    13·1 answer
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter. Ex: sortArray = {10,
    8·1 answer
  • You can display content variations to mobile, tablet or desktop users.
    12·1 answer
  • Which data type or collection of data types can SOQL statements populate or evaluate to?
    9·1 answer
  • What is the name of the popular DBMS (database management system) that is open source and is distributed under the General Publi
    15·1 answer
  • What is the best operating system
    12·1 answer
  • You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
    9·1 answer
  • What is technology in computer​
    6·1 answer
  • How do you think weather can affect sailing?<br><br>What would be good sailing weather?​
    9·1 answer
  • Assume there is a 30-byte heap. The free list for this heap has two elements on it. One entry describes the first 10-byte free s
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!