Guest User

Untitled

a guest
Jul 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. TITLE TestScoreEvaluation Program
  2.  
  3. INCLUDE Irvine32.inc
  4.  
  5. .data
  6. str1 BYTE "Enter the test score: ",0
  7. score DWORD ?
  8. grade BYTE ?
  9.  
  10.  
  11. .code
  12. main PROC
  13. call PromptForInteger
  14. call CheckScore
  15. exit
  16. main ENDP
  17.  
  18. PromptForInteger PROC USES ecx edx esi
  19. mov edx, OFFSET str1
  20. call WriteString
  21. call ReadInt
  22. call Crlf
  23. mov score, eax
  24. ;mov [esi], eax
  25. ;add esi, TYPE DWORD
  26. ret
  27. PromptForInteger ENDP
  28.  
  29. CheckScore PROC USES ecx edx esi
  30. .IF score > 90
  31. mov grade, 'A'
  32. .ELSEIF score > 80
  33. mov grade, 'B'
  34. .ELSEIF score > 70
  35. mov grade, 'C'
  36. .ELSEIF score > 60
  37. mov grade, 'D'
  38. .ELSE
  39. mov grade, 'F'
  40. .ENDIF
  41. mov edx, OFFSET grade
  42. call WriteString
  43. call Crlf
  44. ret
  45. CheckScore ENDP
  46.  
  47. END main
Add Comment
Please, Sign In to add comment