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
Marrrta [24]
3 years ago
11

Write a MIPS assembly language program that finds maximum element in an array of integers. Print the Result Array. You do not ne

ed to read elements of array from keyboard, Just declare them.
Computers and Technology
1 answer:
qwelly [4]3 years ago
3 0

Answer and Explanation:

The program using Assembly language to calculate maximum value in array is given as below:

.data

space: .asciiz " "

X: .word 31, 17, 92, 46, 172, 208, 13, 93, 65, 112

N: .word 10

.text

main: la $a0, X #$a0=load address of array X

lw $a1, N #$a1=10 --number elements

jal readArray #call readArray

li $v0, 10 #exit program

syscall

readArray:

li $t0, 0 #$t0=0

li $t1, 0 #$t1=0

buc: bge $t0, $a1, final #if $t0 >= $a1 then goto final

lw $a0, X($t1) #$a0 = X(i)

li $v0, 1 #Print integer

syscall

la $a0, space #load a space: " "

li $v0, 4 #print string

syscall

addi $t1, $t1, 4 #Every 4 bytes there is an integer in the array

addi $t0, $t0, 1 #$t0=$t0+1

b buc #goto buc

final:

jr $ra #return

The algorithm which are the steps used above is:

Declares array of integers

Calls declared array

Reads declared array and compares integer values stored with if statements to make swap

prints array

Exits

You might be interested in
What is autofill in a excel spreadsheet?
Digiron [165]
Autofill is to automaticlly put the information in a spreadsheet
5 0
3 years ago
What is a computer ?​
Ivenika [448]

Answer:

Computer

Explanation:

Computer defines to an electronic device for storing and processing data, typically in binary form, according to instructions given to it in a variable program.

4 0
3 years ago
Read 2 more answers
Given : an int variable k, an int array currentMembers that has been declared and initialized, an int variable nMembers that con
atroni [7]

Answer:

The following are the code in the Java Programming Language.

//set the for loop

for (k = 0; k < nMembers; k++)

{

//check that currentMembers[k] is equal to the memberID

if (currentMembers[k] == memberID)

{

//then, initialize isAMember to true

isAMember = true;

//and initialize the value of nMembers in k

k = nMembers;

}

//otherwise

else

{

//initialize isAMember to false

isAMember = false;

}

}

Explanation:

<u>The following are the description of the program</u>.

  • Set the for loop statement that iterates from 0 and stops at the variable 'nMembers'.
  • Set the if conditional statement that checks the variable 'currentMembers[k]' is equal to the variable 'memberID' then, initialize 'true' boolean value in the variable 'isAMember' and also initialize the value of the variable 'nMembers' in the variable 'k'.
  • Otherwise, initialize 'false' boolean value in the variable 'isAMember'.
6 0
3 years ago
On a Windows network share, if the user can add, edit, and delete files and folders within the LabFiles folder, what type of acc
Colt1911 [192]

Answer:

Modify

Explanation:

When people like your family or friends can access a computer, then the need to have permissions would certainly come in handy. There are six basic types of permission one can choose from and the modify option is one of them. It simply grants the holder the ability to read and write files and subfolders and also allows for the deletion of folders and files.

6 0
3 years ago
With consideration to Ethernet, why is it necessary to have a common language for communication across devices
Travka [436]

Yes the ansewer is c bc you can look it up!

3 0
3 years ago
Other questions:
  • Which of the following devices electronically sorts mail by ZIP code? A. Fax modem B. Electronic organizer C. Optical character
    10·1 answer
  • a certain battery can supply 6 J of energy to every coulomb of charge moving through a circuit. if the circuit consists of two i
    13·1 answer
  • Two of the goals of community mobilization are getting the community interested and
    6·1 answer
  • Emily has to create an audio-visual presentation on animated movies. Which input device will she be LEAST likely to use while cr
    6·1 answer
  • Fill in the blank
    15·1 answer
  • How we can load program on the browser window.​
    7·2 answers
  • Who loves you tube , anyone?
    10·2 answers
  • When people receive benefits just because they belong to a particular identity group, this is called
    14·1 answer
  • Which computer peripheral is used when you would like to use a DVD or CD?
    12·2 answers
  • Identify the true statements about the approach to privacy around the world. a. Uncertainty concerning the nature, extent, and v
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!