The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
gnmem 3 C' 0 i Secure l hflps://courses.eas.asu.edu/c5€230/current/assignments/assignmentbhtml 72: _Q -5] <27 [Q as signrnenté .s Objectives: -write assembly language programs to:
-defl.ne procedures and call them.
-create loops
-use syscall operations to display integers and strings on the console Window
-use syscall operations to read integers from the keyboard. Assignment Description: Implement a MIPS assembly language program that defines main, readArray and removeEvenOdd procedures. The readArray takes an array of integers as its parameter, reads in integers from a user to fill the array and also print each value as long as it is with the number of elements specified by the parameter "howMany" and "length". The removeEvenOdd procedure takes parameters of an array of integers, its length, and even value, an asks a user how many integers to read in and calls the readyArray procedure. Then it should go through the array to see if each
number is even (divisible by 2) if the parameter even is 0. In that case, such even integer in the array is changed to 1. If the parameter even is 1, then it changes every odd integer in the array to 0. Then it print: out the updated content
of the array. The main procedure asks a user to specify Wheflser to remove even or odd numbers by asking them to enter an integer. Then it calls the removeEvenOdd procedure. It repeats these two steps twice. Please see the following C program to understand how it should work.
17 your program causes an Infinite loop» press Control and 'C' keys at the same time to stop it.
Name your source code file assignment6.s. The following shows how it looks like in a C program: [/The readnrray pro(edur‘e reads integers From user input
//and prints ea<h element in tha array
void readArray(int array, int length, int howMany) { int nun, i : a; prinb’C " The array Content : \n" ); while (i < hanany as i < length) {
printf("Enter‘ an integar: \n"),-
[Need an integer from a user input and store it in numl
5(anf("%d", 3min);
array[i] : num;
i++5
l print‘F("The array tontent:\n");
----------- ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly