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
netineya [11]
3 years ago
10

Write a MIPS assembly language program that prompts for a user to enter how many floating point numbers to enter, then prompts t

o enter a series of floating point numbers and reads in numbers and store them in an array, then prints the original content of the array. Then it repeats it for a second array, and compare numbers from two arrays, and if a number in the first array is larger than the number of the second array of the same index, it swaps them. Then it should print the result contents for both arrays.
Computers and Technology
1 answer:
Natalija [7]3 years ago
5 0

Answer:

See explaination

Explanation:

.data

arraysize: .word 10

counter: .word 1

alreadystored: .word 0

num: .space 40 # reserve 40 bytes from the starting address of array

inputmsg: .asciiz "Enter a floating point number:\n"

outputmsg: .asciiz "The array contains the following numbers: \n"

.text

.globl main

main:

lw $t1, counter #counter

lw $t2, arraysize #max length of array

la $t0, num # base address of the array

#set initial flag for duplicate array element 0=entered value not present in array,1= entered value exists in array

li $t3,0 #reset the flag for alreadystored to 0

Loop 1:

# print input message prompt

la $a0, inputmsg

li $v0, 4

syscall

# get user entered keyboard input

li $v0, 6

syscall

# move user entered value from $f0 to array base address

s.s $f0, 0($t0)

#load the value at address pointed by $t0 to register $f1

l.s $f1,0($t0)

#compare the entered value in register $f0 to the value stored in $f1

c.eq.s $f1,$f0

#jump to loop2 if the values are not equal ie if the entered value is not duplicate then increment the array index and compare with next array element

bc1f loop2

#else make the value of flag alreadystored =1

li $t3,1

# if no duplicate then move to the next position in the array, increment loop counter

loop2:

addi $t0, $t0, 4

addi $t1, $t1, 1

ble $t1, $t2, Loop1

# reset loop counter, and array address for printing out the array elements

lw $t1,counter

la $t0, num

# print output message prompt

la $a0, outputmsg

li $v0, 4

syscall

print_array:

# print array elements

l.s $f12, 0($t0)

li $v0, 2

syscall

# print space

la $a0, 32

li $v0, 11

syscall

# increment loop counter and move to next array element

addi $t1, $t1, 1

addi $t0, $t0, 4

ble $t1, $t2, print_array

#Exit

li $v0,10

syscall

You might be interested in
What are the six critical components of an information system? Select three of the six components, and describe a potential vuln
Blizzard [7]
People, procedures and instructions, data, software, information technology infrastructure, internal controls.
7 0
3 years ago
What are the different parts of a word processing program?<br><br> I need this ASAP please help!!
uranmaximum [27]

Answer:

The basics of the Word window

Title bar. This displays the document name, followed by a program name.

Menu bar. This contains a list of options to manage and customize documents.

Standard toolbar. ...

Formatting toolbar. ...

Ruler. ...

Insertion point. ...

End-of-document marker. ...

Help.

3 0
3 years ago
While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The changes
rjkz [21]

While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The changes did not solve the problem and were not saved. The technician can<u> Issue the reload command without saving the running configuration.</u>

Explanation:

  • The technician does not want to make any mistakes trying to remove all the changes that were done to the running configuration file.
  • The solution is to reboot the router without saving the running configuration. The copy startup-config running-configcommand does not overwrite the running configuration file with the configuration file stored in NVRAM, but rather it just has an additive effect.
  • Configuration change control is a set of processes and approval stages required to change a configuration item's attributes and to re-baseline them.
  • Configuration status accounting is the ability to record and report on the configuration baselines associated with each configuration item at any moment of time.
  • The Manage System Configuration screen allows you to download, save, switch, revert and delete system configuration files.
  • Configuration Control is the activity of managing the product and related documents, throughout the lifecycle of the product.

6 0
3 years ago
Why is the Operating System the most important system software in a computer?
OleMash [197]

Answer:

(Hope this helps can I pls have brainlist (crown)☺️)

Explanation:

The most crucial programme that runs on a computer is the operating system. It controls the memory and operations of the computer, as well as all of its software and hardware. It also allows you to communicate with the computer even if you don't understand its language.

An operating system is a piece of software that manages files, manages memory, manages processes, handles input and output, and controls peripheral devices like disc drives and printers, among other things.

7 0
3 years ago
You have decided to remove a recently installed feature which method can you use to remove this feature
Aliun [14]
If it is on the desktop screen you just right click on the icon and select delete. from there if you're on a windows computer it goes to your recycle bin then you right click the recycle bin and a little rectangle pops up an in that rectangle it says clear recycle bin and once you press that all of the stuff that was in there is deleted. now if your on a computer that has chrome os installed you just go to the files screen and right click what you want to delete and click delete and it's gone. 
6 0
3 years ago
Other questions:
  • What is the legal right granted to all authors and artists that gives them sole ownership and use of their words, software, pict
    9·2 answers
  • Which of the following is an advantage to using plain text format? Check all of the boxes that apply.
    15·2 answers
  • Computer programs and games are called what?
    13·1 answer
  • The main memory of a computer is made up of a set of memory chips called ___ and ___.
    10·1 answer
  • A technician needs to be prepared to launch programs even when utility windows or the Windows desktop cannot load. What is the p
    11·1 answer
  • Think of an aspect of HTML that you found challenging to master. Why is that aspect of HTML important? What are some future situ
    6·1 answer
  • A wide-angle lens corrected for barrel distortion is called a(n)<br> lens.
    5·1 answer
  • What note for percussun is this??
    12·1 answer
  • How many people did you help today
    11·2 answers
  • Draw the following diagrams to represent the information system chosen in assignment 1 Context diagram The context diagram is ex
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!