This assignment is for the assembly language class, so please use assembly langu
ID: 3676969 • Letter: T
Question
This assignment is for the assembly language class, so please use assembly language to do this assignment.
Please do not copy someone's code that is close to this assignment, if u can please use comment after each code to explain why u use it.
Really appreciate for your help.
1. a. Create a procedure (GetInput) that asks the user for N, j and k. Thisprocedure will not receive anything from the calling procedure. N, j and k will beunsigned values and will have to be passed back to the calling procedure viaregisters. N is a number between 0 and 50 and j < k. if N is greater than 50, askthe user for another number. If j >= k ask the user to re-enter those numbers.
b. Create a procedure (ArrayFill) that fills an array of doublewords with N (N <50) random integers, making sure the values fall within the range j…k inclusive.When calling the procedure, pass a pointer to the array that will hold the data,pass N, and pass the values of j and k. Preserve all register values between callsto the procedure.
Since we cannot generate an array on the fly, you may declare an array ofDWORDs that is 50 elements long.
c. Write a procedure (RandomColor) that randomly generates an integerbetween 0 and 9. Use this integer along with the hint below to pick what colorwill be used when displaying text. The probabilities for each color are:
Blue = 30% Red = 10% Green = 60%
HINT: If the integer is between 0-2 (inclusive), choose blue If the integer = 3, choose red If the integer is in the range 4-9 (inclusive), choose green.
d. Create a menu (MainMenu) that provides the following options.
1) Print Randomly Generated Arrays2) Repeat3) Quit
You must use cmp and jcond in the menu. DO NOT USE table-driven selection foryour menu.
Option 1 requires the user to enter the requested values.
Option 2 prints the randomly generated arrays again with previously enteredvalues. (You do not have to error check that there are previously entered values.)
Option 3 – cleanly exit. No segmentation faults etc.If the user enters an invalid option, redisplay the menu and ask for a valid option.
2. Create a program that uses all of the above procedures to print a randomlygenerated array of numbers in a randomly chosen color (as specified by theRun your program 10 times, do the probabilities hold? Provide the analysis toshow that the probabilities hold or not. Submit a pdf with your analysis.
1. Any output will be shown in the console window.
2. You may use any command Chapter 6 and below.
3. Your procedure(s) must be called from the main procedure.
Explanation / Answer
c)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.