Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write an assembly program that asks for the number of integers to be read. It then dynamically allocates an array of that size. It will

image text in transcribed

Write an assembly program that asks for the number of integers to be read. It then dynamically allocates an array of that size. It will stop reading integers when the array is full. After all the integers are read and validated, th average of the entries to 4 decimal places using only MIPS Integer commands. There will be at least 4 subprograms e program displays the entries in reverse order, the sum of the entries, and the The first subprogram 'allocate array' will ask the user for the number of integers to be read and OUT, the dynamically declares an array to hold them. It receives no arguments IN and has two arguments base address of the dynamically declared array and it size. Do not forget to validate array size (array size should be greater than zero) The second subprogram 'read values' which receives two arguments IN, the array base address and its size. Also, it makes sure that each entered number is non-negative and divisible by 2 and 3. It returns (OUT) the sum of valid numbers read in the appropriate registers The third d subprogram 'print backwards' receives the base address of the array and its size as arguments IN. It has no arguments OUT. It outputs the array in reverse order one number per line at a time. Hint: Ex: Your array len gth-6. Element type-Word / Integer #element0 | felementl | felement2 | felement3 | #element4l #elementS You need to print the last element first. So, at the beginning of your printing backwards iteration, at least one of your register should hold the address of the Arrow Marked location of your array The fourth subprogram print average, which receives as arguments IN the total, and count' and has no arguments OUT. It outputs the average of the numbers read to 4 decimal places using only integer commands Write an assembly program that asks for the number of integers to be read. It then dynamically allocates an array of that size. It will stop reading integers when the array is full. After all the integers are read and validated, th average of the entries to 4 decimal places using only MIPS Integer commands. There will be at least 4 subprograms e program displays the entries in reverse order, the sum of the entries, and the The first subprogram 'allocate array' will ask the user for the number of integers to be read and OUT, the dynamically declares an array to hold them. It receives no arguments IN and has two arguments base address of the dynamically declared array and it size. Do not forget to validate array size (array size should be greater than zero) The second subprogram 'read values' which receives two arguments IN, the array base address and its size. Also, it makes sure that each entered number is non-negative and divisible by 2 and 3. It returns (OUT) the sum of valid numbers read in the appropriate registers The third d subprogram 'print backwards' receives the base address of the array and its size as arguments IN. It has no arguments OUT. It outputs the array in reverse order one number per line at a time. Hint: Ex: Your array len gth-6. Element type-Word / Integer #element0 | felementl | felement2 | felement3 | #element4l #elementS You need to print the last element first. So, at the beginning of your printing backwards iteration, at least one of your register should hold the address of the Arrow Marked location of your array The fourth subprogram print average, which receives as arguments IN the total, and count' and has no arguments OUT. It outputs the average of the numbers read to 4 decimal places using only integer commands

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions

Question

How do members envision the ideal team?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago