-
Notifications
You must be signed in to change notification settings - Fork 0
/
grade.asm
125 lines (87 loc) · 1.15 KB
/
grade.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
include irvine32.inc
.data
str1 byte "Enter the Number: ",0
str2 byte "The grade is: ",0
str3 byte "Invalid entry",0
var1 byte 0
grad1 byte 'A'
grad2 byte 'B'
grad3 byte 'C'
grad4 byte 'D'
grad5 byte 'F'
.code
main proc
xor eax,eax
mov edx,offset str1
call writestring
call readint
cmp al,100
je L1
ja l7
cmp al,90
jae L1
cmp al,89
je L2
cmp al,80
jae L2
cmp al,79
je L3
cmp al,70
jae L3
cmp al,69
je L4
cmp al,60
jae L4
cmp al,59
je L5
cmp al,0
jae L5
jb L8
L1:
mov edx,offset str2
call writestring
mov al,grad1
call writechar
call crlf
exit
L2:
mov edx,offset str2
call writestring
mov al,grad2
call writechar
call crlf
exit
L3:
mov edx,offset str2
call writestring
mov al,grad3
call writechar
call crlf
exit
L4:
mov edx,offset str2
call writestring
mov al,grad4
call writechar
call crlf
exit
L5:
mov edx,offset str2
call writestring
mov al,grad5
call writechar
call crlf
exit
L7:
mov edx,offset str3
call writestring
call crlf
exit
L8:
mov edx,offset str3
call writestring
call crlf
exit
exit
main endp
end main