Question: Using MASM irvine 3 2 . inc Corrrect my program it runs incorrectly. Your program will require to get 5 integers from the user. Store
Using MASM irvineinc
Corrrect my program it runs incorrectly. Your program will require to get integers from the user. Store these
numbers in an array. You should then display stars depending on those
numbers. If it is between and you should display stars, so you are
displaying a star for every points in grade. Your program will have a
function to get the numbers from the user and another function to display the
stars.
Example:
the Grades the user input
I will check the code to make sure you used arrays and loops correctly. I
will input different numbers, so make it work with any I will try very large
numbers too so it should use good logic when deciding how many stars to
place
This is my current code
TITLE MASM template
Include Irvineinc
data
Intro BYTE "Enter Your five grades: dhah
grades DWORD DUP
starsmsg BYTE
code
main PROC
;mov edx, offset Intro
;call writestring
call GetGrades
call DisplayStars
exit
main ENDP
GetGrades PROC
mov esi, offset grades
mov ecx, ;counter
inputloop:
mov edx, OFFSET Intro
call WriteString
call ReadInt
mov esi eax
add esi, ; next
loop inputloop
ret
GetGrades ENDP
DisplayStars PROC
mov ecx,
mov esi, OFFSET grades
DisplayLoop:
mov eax, esi
mov ebx,
xor edx, edx
div ebx
;mov ecx, edx
call WriteStars
call Crlf
add esi,
loop displayLoop
ret
DisplayStars ENDP
WriteStars PROC
mov ecx, eax
starLoop:
mov edx, OFFSET starsmsg
call WriteString
loop starLoop
ret
WriteStars ENDP
END main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
