-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquizsystem.asm
477 lines (391 loc) · 6.46 KB
/
quizsystem.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
TITLE Quiz Mangement System
INCLUDE Irvine32.inc
;BUFFER_SIZE = 501
.data
msg1 byte " ******HERE IS A SIMPLE QUIZ FOR YOU******",0
msg2 byte " BELOW MENTIONED SOME RULES ",0
msg3 byte " Rule 1: If your answer is correct answer you will get 1 point.",0
msg4 byte " Rule 2: But if you answer is wrong 1 point will be deducted from your points",0
msg5 byte " Press enter to start your turn",0
msg6 byte "Good! Your answer is Right..",0
msg7 byte "Ohh Sorry!! Wrong answer..",0
msg8 byte "your quiz has been completed",0
msg9 byte "And here comes your total obtained scores: ",0
msg10 byte "Kindly press 1 IF you want to restart the quiz ELSE press 0 to exit",0
msg11 byte "Thank You For being Here, You played so well",0
msg12 byte "Press 1 to restart quiz:",0
Question1 byte "Question1)which one of the following is not a primary color?:",0
QA1 byte "1) yellow 2)red 3) green 4) blue",0
Question2 byte "Q2)which is the colour of sky",0
QA2 byte "1) violet 2) blue 3) black 4) red ",0
Question3 byte " Q3)which of the following is not a natural number:",0
QA3 byte "1) 16 2) 32 3) 4 4) 0",0
Question4 byte "Q4)which one of following has largest precedence:",0
QA4 byte "1) () 2)* 3) + 4) /",0
Question5 byte "Q5)how many alphabets are there in english:",0
QA5 byte "1) 22 2) 223 3) 23 4) 26",0
Question6 byte "Q6)pakistan is in:",0
QA6 byte "1)iceland 2)africa 3) asia 4)europe",0
Question7 byte "Q7)1 kilo is equal to:",0
QA7 byte "1) 1900grams 2) 1000 gram 3) 100 gram 4) 2000gramss",0
Question8 byte "Q8)total provinces of pakistan:",0
QA8 byte "1) 4 2) 5 3) 3 4) 6",0
Question9 byte "'Q9)when pakistan came into being:",0
QA9 byte "1) 1947 2) 1948 3) 1945 4) 1949",0
Question10 byte "Q10)total numbers of cards in the deck are:",0
QA10 byte "1) 52 2) 53 3) 54 4) 51",0
Points dword 0
Value dword ?
.code
main PROC
mov dh,3
mov dl,20
call GotoXY
mov edx,0
mov edx,offset msg1
call writestring
call crlf
mov edx,0
mov edx,offset msg2
call writestring
call crlf
mov edx,0
mov edx,offset msg3
call writestring
call crlf
mov edx,0
mov edx,offset msg4
call writestring
call crlf
mov edx,0
mov edx,offset msg5
call writestring
call crlf
start:
mov bx,0
call crlf
;Question no 1
mov edx,0
mov edx,offset Question1
call writestring
call crlf
mov edx,0
mov edx,offset QA1
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 1
cmp Value,eax
je Equal
jne Notequal
Equal:
mov eax,0
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp labelQ2
Notequal:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 2
labelQ2:
mov edx,0
mov edx,offset Question2
call writestring
call crlf
mov edx,0
mov edx,offset QA2
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 2
cmp Value,eax
je Equal2
jne Notequal2
Equal2:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q3
Notequal2:
mov edx,0
mov edx,offset msg7
call writestring
;Question no 3
Q3:
mov edx,0
mov edx,offset Question3
call writestring
call crlf
mov edx,0
mov edx,offset QA3
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 4
cmp Value,eax
je Equal3
jne Notequal3
Equal3:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q4
Notequal3:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 4
Q4:
mov edx,0
mov edx,offset Question4
call writestring
call crlf
mov edx,0
mov edx,offset QA4
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 1
cmp Value,eax
je Equal4
jne Notequal4
Equal4:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q5
Notequal4:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 5
Q5:
mov edx,0
mov edx,offset Question5
call writestring
call crlf
mov edx,0
mov edx,offset QA5
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 4
cmp Value,eax
je Equal5
jne Notequal5
Equal5:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q6
Notequal5:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 6
Q6:
mov edx,0
mov edx,offset Question6
call writestring
call crlf
mov edx,0
mov edx,offset QA6
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 3
cmp Value,eax
je Equal6
jne Notequal6
Equal6:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q7
Notequal6:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 7
Q7:
mov edx,0
mov edx,offset Question7
call writestring
call crlf
mov edx,0
mov edx,offset QA7
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 2
cmp Value,eax
je Equal7
jne Notequal7
Equal7:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q8
Notequal7:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 8
Q8:
mov edx,0
mov edx,offset Question8
call writestring
call crlf
mov edx,0
mov edx,offset QA8
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 1
cmp Value,eax
je Equal8
jne Notequal8
Equal8:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q9
Notequal8:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 9
Q9:
mov edx,0
mov edx,offset Question9
call writestring
call crlf
mov edx,0
mov edx,offset QA9
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 1
cmp Value,eax
je Equal9
jne Notequal9
Equal9:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Q10
Notequal9:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
;Question no 10
Q10:
mov edx,0
mov edx,offset Question10
call writestring
call crlf
mov edx,0
mov edx,offset QA10
call writestring
call crlf
call Readint
mov Value, eax
mov eax,0
mov eax, 1
cmp Value,eax
je Equal10
jne Notequal10
Equal10:
mov eax,Points
inc eax
mov Points,eax
mov edx,0
mov edx,offset msg6
call writestring
call crlf
jmp Result
Notequal10:
mov edx,0
mov edx,offset msg7
call writestring
call crlf
Result:
mov edx,0
mov edx,offset msg9
call writestring
mov eax, 0
mov eax,Points
call writeint
call crlf
mov edx,0
mov edx,offset msg12
call writestring
call readint
cmp eax,1
je start
call readint
main ENDP
END main