Question: Write a program in Easy68K , assembler language Questio n: (100 pts.) Please initialize an array [5, 0, 12, 3, 8, 21, 1, 14, 2,
Write a program in Easy68K, assembler language
Question: (100 pts.)
Please initialize an array [5, 0, 12, 3, 8, 21, 1, 14, 2, 16], and do the following operations on this array. You need to use subroutine and branch to finish this question. There should be 3 major subroutines in the program, one for each requirement given below:
Keep loading numbers from keyboard until the input is 1 or 2.
In the 1st subroutine, load the input from keyboard. Decide whether the input is 1 or 2, and ask to load another input if its neither 1 nor 2. Store the value only when its 1 or 2 and continue to part b); (20 pts.)
Go through all the elements and pass current odd/even number to subroutine c) to output.
In the 2nd subroutine, find out all odd/even elements in the initialized array. That is, if the stored input is 1 in part a), use the 3rd subroutine to print out ONLY the elements with odd values decided by the program (5, 3, 21, 1). If the stored input is 2 in part a), use the 3rd subroutine to print out ONLY the elements with even values decided by the program (0, 12, 8, 14, 2, 16); (60 pts.)
Print out value passed by subroutine b) with CRLF.
In the 3rd subroutine, print out the value from subroutine b) on separate lines. You need to call this subroutine 4 or 6 times in subroutine b) to print out odd/even numbers. (20 pts.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
