-
Notifications
You must be signed in to change notification settings - Fork 1
/
ProcTable.asm
executable file
·71 lines (61 loc) · 1.2 KB
/
ProcTable.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
INCLUDE Irvine32.inc
.data
CaseTable BYTE 'A'
DWORD Process_A
BYTE 'B'
DWORD Process_B
BYTE 'C'
DWORD Process_C
BYTE 'D'
DWORD Process_D
BYTE 'F'
DWORD Process_F
NumberOfEntries = 5
prompt BYTE "Press select your grade (A,B,C, etc.) to check your overall %:", 0
msgA BYTE "You scored between 90 and 100%!",0
msgB BYTE "You scored between 80 and 89%",0
msgC BYTE "You scored between 70 and 79%",0
msgD BYTE "You scored between 60 and 69%",0
msgF BYTE "You scored between 0 and 59%, better luck next time.",0
.code
main PROC
mov edx,OFFSET prompt
call WriteString
call ReadChar
mov ebx,OFFSET CaseTable
mov ecx,NumberOfEntries
call Crlf
L1:
cmp al,[ebx]
jne L2
call NEAR PTR [ebx + 1]
call WriteString
call Crlf
jmp L3
L2:
add ebx,5
loop L1
L3:
exit
main ENDP
Process_A PROC
mov edx,OFFSET msgA
ret
Process_A ENDP
Process_B PROC
mov edx,OFFSET msgB
ret
Process_B ENDP
Process_C PROC
mov edx,OFFSET msgC
ret
Process_C ENDP
Process_D PROC
mov edx,OFFSET msgD
ret
Process_D ENDP
Process_F PROC
mov edx,OFFSET msgF
ret
Process_F ENDP
END main