-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlaying with Options.asm
151 lines (137 loc) · 3.01 KB
/
Playing with Options.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
; @author: Nilay Chandra Barman (https://github.com/Nilaycb)
; Copyright (c) 2019, All rights reserved.
; Copyrights licensed under the GNU AGPLv3 License.
.MODEL SMALL
.STACK 100H
.DATA
MENU DB "--------MENU----------$"
MENUEND DB 10,13,"----------------------$"
MENU1 DB 10,13,"1. Apple$"
MENU2 DB 10,13,"2. Banana$"
MENU3 DB 10,13,"3. Cherry$"
MENU4 DB 10,13,"4. Dates$"
MENU5 DB 10,13,"5. Egg$"
MENU6 DB 10,13,"6. EXIT$"
MSG DB 10,13,"Choose a number from the options to see more details: $"
NL DB 10,13,"$"
DETAILS DB "--------DETAILS----------$"
DETAILSEND DB 10,13,"-------------------------$"
DETAILS1 DB 10,13,"Apple is a fruit.$"
DETAILS2 DB 10,13,"Banana is a fruit.$"
DETAILS3 DB 10,13,"Cherry is a fruit.$"
DETAILS4 DB 10,13,"Dates is a fruit.$"
DETAILS5 DB 10,13,"Egg is food.$"
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
MOV AH,9
MOV DX,OFFSET MENU
INT 21H
MOV DX,OFFSET MENU1
INT 21H
MOV DX,OFFSET MENU2
INT 21H
MOV DX,OFFSET MENU3
INT 21H
MOV DX,OFFSET MENU4
INT 21H
MOV DX,OFFSET MENU5
INT 21H
MOV DX,OFFSET MENU6
INT 21H
MOV DX,OFFSET MENUEND
INT 21H
INPUT:
MOV AH,9H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET MSG
INT 21H
MOV DX,OFFSET NL
INT 21H
MOV AH,1
INT 21H
CMP AL,'1'
JE M1
CMP AL,'2'
JE M2
CMP AL,'3'
JE M3
CMP AL,'4'
JE M4
CMP AL,'5'
JE M5
CMP AL,'6'
JE EXIT
JMP INPUT
M1:
MOV AH,9H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET DETAILS
INT 21H
MOV DX,OFFSET DETAILS1
INT 21H
MOV DX,OFFSET DETAILSEND
INT 21H
JMP EXIT
M2:
MOV AH,9H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET DETAILS
INT 21H
MOV DX,OFFSET DETAILS2
INT 21H
MOV DX,OFFSET DETAILSEND
INT 21H
JMP EXIT
M3:
MOV AH,9H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET DETAILS
INT 21H
MOV DX,OFFSET DETAILS3
INT 21H
MOV DX,OFFSET DETAILSEND
INT 21H
JMP EXIT
M4:
MOV AH,9H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET DETAILS
INT 21H
MOV DX,OFFSET DETAILS4
INT 21H
MOV DX,OFFSET DETAILSEND
INT 21H
JMP EXIT
M5:
MOV AH,9H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET NL
INT 21H
MOV DX,OFFSET DETAILS
INT 21H
MOV DX,OFFSET DETAILS5
INT 21H
MOV DX,OFFSET DETAILSEND
INT 21H
JMP EXIT
EXIT:
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN