Question
PLEASE WRITE IN ASSEMBLY LANGUAGE Task 1: Create a userint procedure. The user will enter a number between 0-100. If the number is 0, exit
PLEASE WRITE IN ASSEMBLY LANGUAGE
Task 1:
Create a userint procedure. The user will enter a number between 0-100. If the number is 0, exit the program. If the number is > 100 get another number from the user. This number deteremines how many grades will be entered by the user. The largest array to be generated is of maxLength = 100.
Otherwise, put the user entered number in EAX and call the following procedure. You may assume that the array in question is as follows
Grades WORD maxLength DUP (0h)
The create a procedure (rawGrades) that generates numbers between 50 and 100 inclusively.
Receives: Offset of the WORD array in EBX, how many numbers to generate in EAX.
Returns: nothing except that the generated number will be in bits 0-7 of each DWORD.
Task 2:
Given information: Grades WORD maxLength DUP (0h)
This array will have necessary information in bits 0 through 7. That information must remain in the array. DO NOT overwrite it.
This procedure (calcGrade) will calculate a letter grade.
Receives: A WORD array offset in EBX. In Bits 0 through 7 of each WORD will be a number. Use this number to determine a letter grade as follows
59 and below : F 60-69 : D
70-79 : C
Etc
Returns: The array modified so that the letter grade is in the bit 8-15 of the DWORD array. You may NOT modify the array in any other way.
Task 3:
Given the following array: Grades WORD maxLength DUP (0h)
Receives the offset to an array in ebx. This array will have a numerical score in bits 0-7 and the associated letter grade in bits 8-15 of each element of the array.
Returns nothing.
This procedure will print a grade and its numerical value in the following format. Use GotoXY (chapter 5) to create the 5 spaces between the integer and the letter grade. Be sure to account for the case where the score is 100.
SCORE Grade
93 (A)
87 (B)
53 (F)
Task 4
Once task 3 is complete and functioning, copy it to another procedure (gradesColor) and modify it so that it prints the grades in color. You must return the color scheme to the default prior to exiting the procedure.
All numbers will be the default color LightGray on Black
Print letter grades ONLY using the following scheme.
NOTE: Only the letter grade shall be in color not the parentheses.
As and Bs in GREEN ON A BLACK BACKGROUND. Cs in YELLOW ON A BLACK BACKGROUND
Ds in BLACK on a YELLOW BACKGROUND Fs in RED on a LIGHT GRAY BACKGROUND
Task 5
Create a procedure that asks the user for a letter grade. Make sure to error check the user entry.
This letter grade will be passed to another procedure which will print each score in the array that corresponds to the letter grade entered by the user. For example, the user enters B. All grades 80-89 in the array should be printed in column form. Also inform the user, how many grades there are.
Example:
There are 5 As:
100
99
98
97
97
At the end of the procedure be sure the user has to press a key to continue
Task 6. Create a menu that will ask the user if they want to generate grades or quit.
Once grades have been generated, ask the user if they want to print all the grades or enter a grade.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started