-
Notifications
You must be signed in to change notification settings - Fork 2
/
RestaurantsBillingSystem.asm
951 lines (707 loc) · 29.3 KB
/
RestaurantsBillingSystem.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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
INCLUDE Irvine32.inc
.DATA
bill DWORD 0 ; To store the bill...
oPrice DWORD 169, 149, 99, 89, 69, 69, 10, 5 ; To store the prices of Oriental...
cPrice DWORD 169, 149, 99, 79 ; To store the prices of Chinese...
fPrice DWORD 149, 99, 79, 49 ; To store the prices of Fast Food...
dePrice DWORD 799, 699, 99, 69 ; To store the prices of Dessert...
drPrice DWORD 99, 99, 49 ,49, 69, 64, 89, 49 ; To store the prices of Drinks...
welcome BYTE " *** Welcome To Restaurant Transylvania *** ", 0 ; Welcome note...
options BYTE " Enter 1 : To see our Menu and Prices.", 0ah, 0dh
BYTE " Enter 2 : To see our Deals and Offers.", 0ah, 0dh
BYTE " Enter 3 : To Place an Order.", 0ah, 0dh
BYTE " Enter 4 : To Reset the Bill [Cancel the order].", 0ah, 0dh
BYTE " Enter 5 : To Exit.", 0ah, 0dh , 0
; Price Menu...
pMenu BYTE " Restaurant Transylvania proudly present our Menu ... ", 0ah, 0dh, 0ah, 0dh
BYTE " *** Oriental *** ", 0ah, 0dh
BYTE " Chicken Quorma : 169 per Dish. ", 0ah, 0dh
BYTE " Pullao : 149 per Dish. ", 0ah, 0dh
BYTE " Chicken Briyani : 99 per Dish. ", 0ah, 0dh
BYTE " Chicken Karahi : 89 per Dish. ", 0ah, 0dh
BYTE " Chicken Tikka : 69 per Dish. ", 0ah, 0dh
BYTE " Murgh Haleem : 69 per Dish. ", 0ah, 0dh
BYTE " Naan : 10 per Piece. ", 0ah, 0dh
BYTE " Roti : 05 per Piece. ", 0ah, 0dh, 0ah, 0dh
BYTE " *** Chinese *** ", 0ah, 0dh
BYTE " Chicken Manchurian with rice : 169 per Plate ", 0ah, 0dh
BYTE " Egg Fried Rice : 149 per Plate ", 0ah, 0dh
BYTE " Chicken Macaroni : 99 per Plate ", 0ah, 0dh
BYTE " Chicken Shashlik : 79 per Plate ", 0ah, 0dh, 0ah, 0dh
BYTE " *** Fast Food *** ", 0ah, 0dh
BYTE " Chicken Pizza : 149 per Pizza. ", 0ah, 0dh
BYTE " Zinger Burger : 99 per Piece. ", 0ah, 0dh
BYTE " Chicken Shawarma : 79 per Piece. ", 0ah, 0dh
BYTE " French Fries : 49 per Packet. ", 0ah, 0dh, 0ah, 0dh
BYTE " *** Dessert *** ", 0ah, 0dh
BYTE " Pineapple Cake : 799 per Pound. ", 0ah, 0dh
BYTE " Chocolate Cake : 699 per Pound. ", 0ah, 0dh
BYTE " Custard : 99 per Bowl. ", 0ah, 0dh
BYTE " Ice-cream : 69 per Cup. ", 0ah, 0dh, 0ah, 0dh
BYTE " *** Drinks *** ", 0ah, 0dh
BYTE " Coca Cola : 99 (1.5) Liters. ", 0ah, 0dh
BYTE " Sprite : 99 (1.5) Liters. ", 0ah, 0dh
BYTE " Coca Cola : 49 Regular. ", 0ah, 0dh
BYTE " Sprite : 49 Regular. ", 0ah, 0dh
BYTE " Pineapple Juice : 69 per Glass. ", 0ah, 0dh
BYTE " Mint Margarita : 64 per Glass. ", 0ah, 0dh
BYTE " Coffee : 89 per Cup. ", 0ah, 0dh
BYTE " Tea : 49 per Cup. ", 0
deals BYTE " *** Deals and Offers *** ", 0ah, 0dh, 0 ; TODO.......
cMenu BYTE " *** Menu *** ", 0ah, 0dh, 0ah, 0dh ; Choice Menu...
BYTE " Enter 1 : For Oriental.", 0ah, 0dh
BYTE " Enter 2 : For Chinese.", 0ah, 0dh
BYTE " Enter 3 : For Fast Food.", 0ah, 0dh
BYTE " Enter 4 : For Dessert.", 0ah, 0dh
BYTE " Enter 5 : For Drinks.", 0ah, 0dh
BYTE " Enter 6 : To Exit.", 0ah, 0dh, 0
oriental BYTE " *** Oriental *** ", 0ah, 0dh
BYTE " Enter 1 : Chicken Quorma : 169 per Dish. ", 0ah, 0dh
BYTE " Enter 2 : Pullao : 149 per Dish. ", 0ah, 0dh
BYTE " Enter 3 : Chicken Briyani : 99 per Dish. ", 0ah, 0dh
BYTE " Enter 4 : Chicken Karahi : 89 per Dish. ", 0ah, 0dh
BYTE " Enter 5 : Chicken Tikka : 69 per Dish. ", 0ah, 0dh
BYTE " Enter 6 : Murgh Haleem : 69 per Dish. ", 0ah, 0dh
BYTE " Enter 7 : Naan : 10 per Piece. ", 0ah, 0dh
BYTE " Enter 8 : Roti : 05 per Piece. ", 0ah, 0dh
BYTE " Enter 9 : To Exit. ", 0ah, 0dh, 0
chinese Byte " *** Chinese *** ", 0ah, 0dh
BYTE " Enter 1 : Chicken Manchurian with rice : 169 per Dish ", 0ah, 0dh
BYTE " Enter 2 : Egg Fried Rice : 149 per Dish ", 0ah, 0dh
BYTE " Enter 3 : Chicken Macaroni : 99 per Dish ", 0ah, 0dh
BYTE " Enter 4 : Chicken Shashlik : 79 per Dish ", 0ah, 0dh
BYTE " Enter 5 : To Exit. ", 0ah, 0dh, 0
fastFood BYTE " *** Fast Food *** ", 0ah, 0dh
BYTE " Enter 1 : Chicken Pizza : 149 per Pizza. ", 0ah, 0dh
BYTE " Enter 2 : Zinger Burger : 99 per Piece. ", 0ah, 0dh
BYTE " Enter 3 : Chicken Shawarma : 79 per Piece. ", 0ah, 0dh
BYTE " Enter 4 : French Fries : 49 per Packet. ", 0ah, 0dh
BYTE " Enter 5 : To Exit. ", 0ah, 0dh, 0
dessert BYTE " *** Dessert *** ", 0ah, 0dh
BYTE " Enter 1 : Pineapple Cake : 799 per Pound. ", 0ah, 0dh
BYTE " Enter 2 : Chocolate Cake : 699 per Pound. ", 0ah, 0dh
BYTE " Enter 3 : Custard : 99 per Bowl. ", 0ah, 0dh
BYTE " Enter 4 : Ice-cream : 69 per Cup. ", 0ah, 0dh
BYTE " Enter 5 : To Exit. ", 0ah, 0dh, 0
drinks BYTE " *** Drinks *** ", 0ah, 0dh
BYTE " Enter 1 : Coca Cola : 99 (1.5) Liters. ", 0ah, 0dh
BYTE " Enter 2 : Sprite : 99 (1.5) Liters. ", 0ah, 0dh
BYTE " Enter 3 : Coca Cola : 49 Regular. ", 0ah, 0dh
BYTE " Enter 4 : Sprite : 49 Regular. ", 0ah, 0dh
BYTE " Enter 5 : Pineapple Juice : 69 per Glass. ", 0ah, 0dh
BYTE " Enter 6 : Mint Margarita : 64 per Glass. ", 0ah, 0dh
BYTE " Enter 7 : Coffee : 89 per Cup. ", 0ah, 0dh
BYTE " Enter 8 : Tea : 49 per Cup. ", 0ah, 0dh
BYTE " Enter 9 : To Exit. ", 0ah, 0dh , 0
reMsg BYTE " Your Order has been Canceled... ", 0ah, 0dh, 0
dishes BYTE " Enter the Quantity: ", 0
caption BYTE "Error", 0
errMsg BYTE " Please follow instructions correctly... ", 0
billMsg BYTE " Total Bill: Rs ", 0
exitMsg BYTE " We are always glad to serve our Customers... ", 0ah, 0dh, 0
haltMsg BYTE " Press Enter to continue... ", 0
.CODE
main PROC
call crlf
mov edx, OFFSET welcome ; Printing Welcome...
call writeString
call crlf
call crlf
op: ; Option Tag...
mov edx, OFFSET options ; Printing options...
call writeString
call crlf
call readInt
cmp eax, 1
je pm
cmp eax, 2
je do
cmp eax, 3
je cm
cmp eax, 4
je rb
cmp eax, 5
je _exit
call error ; calling error Proc...
jmp op
pm: ; Price Menu Tag...
call printMenu
call halt
jmp op
do: ; Deals and Offers Tag...
call dealsOffers
jmp op
cm: ; Choice Menu Tag...
call choiceMenu
jmp op
rb: ; Reset Bill Tag...
call resetBill
call halt
jmp op
_exit: ; Exit Tag
call printBill
exit
main ENDP
;-------------------------------------------------------------------
;| Print Menu with Prices for customers... |
;| Uses: pMenu string to print... |
;| Note: push then pop regs and flags in stack to make them const |
;-------------------------------------------------------------------
printMenu PROC
PUSHAD ; Pushing all 32-bit registers...
PUSHFD ; Pushing all flags...
call crlf
mov edx, OFFSET pMenu
call writeString
POPFD ; Popping flags in reverse order...
POPAD ; Popping regs in reverse order...
RET
printMenu ENDP
;-------------------------------------------------------------------
;| Print Deals and Offers with Prices for customers... |
;| Uses: deals string to print... |
;| update: bill according to selected Deals and Offers |
;-------------------------------------------------------------------
dealsOffers PROC
PUSHAD
PUSHFD
call crlf
mov edx, OFFSET deals
call writeString
POPFD
POPAD
RET
dealsOffers ENDP
;-------------------------------------------------------------------
;| Print Menu with Prices for customers to order... |
;| Uses: pMenu string to print... |
;-------------------------------------------------------------------
choiceMenu PROC
PUSHAD
PUSHFD
op: ; Option Tag...
call crlf
mov edx, OFFSET cMenu
call writeString
call crlf
call readInt
cmp eax, 1
je ot
cmp eax, 2
je cn
cmp eax, 3
je ff
cmp eax, 4
je de
cmp eax, 5
je dr
cmp eax, 6
je _exit
call error ; calling error Proc...
jmp op
ot: ; Oriental Tag...
call OrientalMenu
jmp op
cn: ; Chinese Tag...
call ChineseMenu
jmp op
ff: ; Fast Food Tag...
call FastFoodMenu
jmp op
de: ; Dessert Tag...
call DessertMenu
jmp op
dr: ; Drinks Tag...
call DrinksMenu
jmp op
_exit: ; Exit Tag
POPFD
POPAD
RET
choiceMenu ENDP
;-------------------------------------------------------------------
;| Print Oriental Menu with Prices for customers to order... |
;| Updates: Bill ... |
;-------------------------------------------------------------------
OrientalMenu PROC
PUSHAD
PUSHFD
op: ; Option Tag...
call crlf
mov edx, OFFSET oriental
call writeString
call crlf
call readInt
cmp eax, 1
je cq
cmp eax, 2
je pu
cmp eax, 3
je cb
cmp eax, 4
je ck
cmp eax, 5
je ct
cmp eax, 6
je mh
cmp eax, 7
je na
cmp eax, 8
je rt
cmp eax, 9
je _exit
call error ; calling error Proc...
jmp op
cq: ; Chicken Quorma Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
pu: ; Pullao Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 4]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
cb: ; Chicken Briyani Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 8]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
ck: ; Chicken Karahi Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 12]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
ct: ; Chicken Tikka Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 16]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
mh: ; Murgh Haleem Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 20]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
na: ; Naan Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 24]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
rt: ; Roti Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [oPrice + 28]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
_exit: ; Exit Tag
POPFD
POPAD
RET
OrientalMenu ENDP
;-------------------------------------------------------------------
;| Print Chinese Menu with Prices for customers to order... |
;| Updates: Bill ... |
;-------------------------------------------------------------------
ChineseMenu PROC
PUSHAD
PUSHFD
op: ; Option Tag...
call crlf
mov edx, OFFSET chinese
call writeString
call crlf
call readInt
cmp eax, 1
je cm
cmp eax, 2
je fr
cmp eax, 3
je mn
cmp eax, 4
je sh
cmp eax, 5
je _exit
call error ; calling error Proc...
jmp op
cm: ; Chicken Manchurian Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [cPrice]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
fr: ; Egg Fried Rice Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [cPrice + 4]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
mn: ; Chicken Macaroni Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [cPrice + 8]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
sh: ; Chicken Shashlik Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [cPrice + 12]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
_exit: ; Exit Tag
POPFD
POPAD
RET
ChineseMenu ENDP
;-------------------------------------------------------------------
;| Print Fast Food Menu with Prices for customers to order... |
;| Updates: Bill ... |
;-------------------------------------------------------------------
FastFoodMenu PROC
PUSHAD
PUSHFD
op: ; Option Tag...
call crlf
mov edx, OFFSET fastFood
call writeString
call crlf
call readInt
cmp eax, 1
je cp
cmp eax, 2
je zb
cmp eax, 3
je sw
cmp eax, 4
je ff
cmp eax, 5
je _exit
call error ; calling error Proc...
jmp op
cp: ; Chicken Pizza Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [fPrice]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
zb: ; Zinger Burger Rice Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [fPrice + 4]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
sw: ; Chicken Shawarma Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [fPrice + 8]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
ff: ; French Fries Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [fPrice + 12]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
_exit: ; Exit Tag
POPFD
POPAD
RET
FastFoodMenu ENDP
;-------------------------------------------------------------------
;| Print Dessert Menu with Prices for customers to order... |
;| Updates: Bill ... |
;-------------------------------------------------------------------
DessertMenu PROC
PUSHAD
PUSHFD
op: ; Option Tag...
call crlf
mov edx, OFFSET dessert
call writeString
call crlf
call readInt
cmp eax, 1
je pc
cmp eax, 2
je cc
cmp eax, 3
je cu
cmp eax, 4
je ic
cmp eax, 5
je _exit
call error ; calling error Proc...
jmp op
pc: ; Pineapple Cake Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [dePrice]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
cc: ; Chocolate Cake Rice Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [dePrice + 4]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
cu: ; Custard Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [dePrice + 8]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
ic: ; Ice-Cream Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [dePrice + 12]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
_exit: ; Exit Tag
POPFD
POPAD
RET
DessertMenu ENDP
;-------------------------------------------------------------------
;| Print Drinks Menu with Prices for customers to order... |
;| Updates: Bill ... |
;-------------------------------------------------------------------
DrinksMenu PROC
PUSHAD
PUSHFD
op: ; Option Tag...
call crlf
mov edx, OFFSET drinks
call writeString
call crlf
call readInt
cmp eax, 1
je cj
cmp eax, 2
je sj
cmp eax, 3
je cr
cmp eax, 4
je sr
cmp eax, 5
je pj
cmp eax, 6
je ma
cmp eax, 7
je co
cmp eax, 8
je te
cmp eax, 9
je _exit
call error ; calling error Proc...
jmp op
cj: ; Coca Cola Jumbo Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
sj: ; Sprite Jumbo Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 4]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
cr: ; Coca Cola Regular Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 8]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
sr: ; Sprite Regular Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 12]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
pj: ; Pineapple Juice Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 16]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
ma: ; Mint Margarita Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 20]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
co: ; Coffee Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 24]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
te: ; Tea Tag...
mov edx, OFFSET dishes
call writeString
call readInt ; Taking input for quantity...
mov ebx, [drPrice + 28]
mul ebx ; Mul quantity with price...
add eax, bill
mov bill, eax
jmp op
_exit: ; Exit Tag
POPFD
POPAD
RET
DrinksMenu ENDP
;-------------------------------------------------------------------
;| Print a message for customers... |
;| Uses: pMenu string to print... |
;| update: Reset the bill to 0... |
;-------------------------------------------------------------------
resetBill PROC
PUSHAD
PUSHFD
call crlf
mov edx, OFFSET reMsg
call writeString
mov bill, 0 ; Making bill 0...
POPFD
POPAD
RET
resetBill ENDP
;-------------------------------------------------------------------
;| Uses: print the bill... |
;-------------------------------------------------------------------
printBill PROC
PUSHAD
PUSHFD
call crlf
mov edx, OFFSET billMsg
call writeString
mov eax, bill
call writeInt
call halt
mov edx, OFFSET exitMsg ; Printing Exit Note/Msg...
call writeString
POPFD
POPAD
RET
printBill ENDP
;-------------------------------------------------------------------
;| Uses: As system pause... |
;-------------------------------------------------------------------
halt PROC
PUSHAD
PUSHFD
call crlf
call crlf
mov edx, OFFSET haltMsg
call writeString
call readInt
call crlf
call crlf
POPFD
POPAD
RET
halt ENDP
;-------------------------------------------------------------------
;| Shows an Error Box to customers... |
;| Uses: 2 strings for an input box... |
;| Advan: It also works as a pause... |
;-------------------------------------------------------------------
error PROC
PUSHAD
PUSHFD
call crlf
mov ebx,OFFSET caption
mov edx,OFFSET errMsg
call MsgBox
POPFD
POPAD
RET
error ENDP
END main