Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TITLE TestScoreEvaluation Program
- INCLUDE Irvine32.inc
- .data
- str1 BYTE "Enter the test score: ",0
- score DWORD ?
- grade BYTE ?
- .code
- main PROC
- call PromptForInteger
- call CheckScore
- exit
- main ENDP
- PromptForInteger PROC USES ecx edx esi
- mov edx, OFFSET str1
- call WriteString
- call ReadInt
- call Crlf
- mov score, eax
- ;mov [esi], eax
- ;add esi, TYPE DWORD
- ret
- PromptForInteger ENDP
- CheckScore PROC USES ecx edx esi
- .IF score > 90
- mov grade, 'A'
- .ELSEIF score > 80
- mov grade, 'B'
- .ELSEIF score > 70
- mov grade, 'C'
- .ELSEIF score > 60
- mov grade, 'D'
- .ELSE
- mov grade, 'F'
- .ENDIF
- mov edx, OFFSET grade
- call WriteString
- call Crlf
- ret
- CheckScore ENDP
- END main
Add Comment
Please, Sign In to add comment