PROGRAM 10: Grade Converter! For this program, I would like you to create a function which returns a character value based on a floating point value as shown below: Percentage Letter Grade 90.0-100.0 A 80.0-89.99 B 70.0-79.99 C 60.0-69.99 D <= 59.99 F Write an HLA Assembly language program that implements the following function: procedure grader( percentage : real32 ); @nodisplay; @noframe; Your function should return in AL the converted character value, as shown in the chart above. (Hint: Since the run-stack doesn't allow for a byte-sized argument to be pushed and popped, you will need to envelope the argument in a larger eight bit argument. The converted letter should be stored into AL) (Another Hint: Please review the Sample Programs in Floating Point unit to see how to compare floating point values. You need to use the floating point instruction fcomp as shown on the second example program.) Feed Me: 94.5 that's the grade: A Feed Me: 78.3 that's the grade: C
For this program, I would like you to create a function which returns a character value based on a floating point value as shown below:
Percentage | Letter Grade |
90.0-100.0 | A |
80.0-89.99 | B |
70.0-79.99 | C |
60.0-69.99 | D |
<= 59.99 | F |
Write an HLA Assembly language program that implements the following function:
procedure grader( percentage : real32 ); @nodisplay; @noframe;
Your function should return in AL the converted character value, as shown in the chart above.
(Hint: Since the run-stack doesn't allow for a byte-sized argument to be pushed and popped, you will need to envelope the argument in a larger eight bit argument. The converted letter should be stored into AL)
(Another Hint: Please review the Sample Programs in Floating Point unit to see how to compare floating point values. You need to use the floating point instruction fcomp as shown on the second example program.)
Feed Me: 94.5
that's the grade: A
Feed Me: 78.3
that's the grade: C
Step by step
Solved in 3 steps with 2 images