-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAddTwo.asm
765 lines (642 loc) · 22.6 KB
/
AddTwo.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
INCLUDE Irvine32.inc
INCLUDE Macros.inc
INCLUDE VirtualKeys.inc
.data
endl EQU <0dh,0ah> ; end of line sequence
message LABEL BYTE
BYTE " " ,endl
BYTE " " ,endl
BYTE " __ __ _______ __ _ _______ __ __ _______ __ _ " ,endl
BYTE " | | | || _ || | | || || |_| || _ || | | | " ,endl
BYTE " | |_| || |_| || |_| || ___|| || |_| || |_| | " ,endl
BYTE " | || || || | __ | || || | " ,endl
BYTE " | || || _ || || || || || _ | " ,endl
BYTE " | _ || _ || | | || |_| || ||_|| || _ || | | | " ,endl
BYTE " |__| |__||__| |__||_| |__||_______||_| |_||__| |__||_| |__| " ,endl
BYTE " " ,endl
BYTE " Copyright (C) 2017 Stefan TESANOVIC 2016/675 " ,endl
BYTE " Predrag MITROVIC 2016/678 " ,endl
BYTE " " ,endl
messageSize DWORD ($-message)
consoleHandle HANDLE 0 ; handle to standard output device
bytesWritten DWORD ? ; number of bytes written
HANGMAN_GOODGAME_00 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| ",endl
BYTE "| O ",endl
BYTE "| /|\ ",endl
BYTE "| / \ ",endl
BYTE "+------------+ ",endl
BYTE "| YOU WIN | ",endl
BYTE "+------------+ ",endl
messageSizeGoodGame DWORD ($-HANGMAN_GOODGAME_00)
HANGMAN_GOODGAME_01 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| ",endl
BYTE "| O_ ",endl
BYTE "| /| ",endl
BYTE "| / \ ",endl
BYTE "+------------+ ",endl
BYTE "| YOU WIN | ",endl
BYTE "+------------+ ",endl
HANGMAN_GOODGAME_02 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| ",endl
BYTE "| O/ ",endl
BYTE "| /| ",endl
BYTE "| / \ ",endl
BYTE "+------------+ ",endl
BYTE "| YOU WIN | ",endl
BYTE "+------------+ ",endl
HANGMAN_GOODGAME_03 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| ",endl
BYTE "| O_ ",endl
BYTE "| /| ",endl
BYTE "| / \ ",endl
BYTE "+------------+ ",endl
BYTE "| YOU WIN | ",endl
BYTE "+------------+ ",endl
HANGMAN_GAMEOVER_00 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| /|\ ",endl
BYTE "| / \ ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| YOU DIE | ",endl
BYTE "+------------+ ",endl
HANGMAN_GAMEOVER_01 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| / ",endl
BYTE "| _O ",endl
BYTE "| _/\ ",endl
BYTE "| \ ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| YOU DIE | ",endl
BYTE "+------------+ ",endl
HANGMAN_GAMEOVER_02 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| /|\ ",endl
BYTE "| / \ ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| YOU DIE | ",endl
BYTE "+------------+ ",endl
HANGMAN_GAMEOVER_03 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| \ ",endl
BYTE "| O_ ",endl
BYTE "| /\_ ",endl
BYTE "| / ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| YOU DIE | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_06 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_05 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_04 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| | ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_03 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| /| ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_02 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| /|\ ",endl
BYTE "| ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_01 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| /|\ ",endl
BYTE "| / ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
HANGMAN_LIVES_00 LABEL BYTE
BYTE "+------+ ",endl
BYTE "| | ",endl
BYTE "| O ",endl
BYTE "| /|\ ",endl
BYTE "| / \ ",endl
BYTE "| ",endl
BYTE "+------------+ ",endl
BYTE "| | ",endl
BYTE "+------------+ ",endl
; random number what we generete
ranNum DWORD ?
;All words what is posible to guess.
;Pick by random generartor and put in selectedWords
manyWords BYTE "BICYCLE", 0
BYTE "CANOE", 0
BYTE "SCATEBOARD", 0
BYTE "OFFSIDE", 0
BYTE "TENNIS", 0
BYTE "SOFTBALL", 0
BYTE "KNOCKOUT", 0
BYTE "CHALLENGE", 0
BYTE "SLALOM", 0
BYTE "MARATHON", 0
BYTE 0 ; End of list
len equ $ - manyWords
; number what we make to know where are you in game
statusGameLive DWORD ?
;Wordls what we select by rundom code
selectedWords BYTE " ", 0
;Use as variable in funcstion for lenght of Array
lengthArray DWORD ?
;Letter what we guess, input from keyboard
guessLetter BYTE ?
;World what we print with -------,0
guessWords BYTE 50 DUP (?)
;Array of guess Letter
guessLetterArray BYTE 50 DUP (?)
chardelete BYTE 'A'
;Letter what are unknows, change with -
letterDash BYTE '-'
drowDelay = 1000 ; delay 1 sec
var_loop BYTE 15 ; repeat 15 times
.code
main PROC
; Get the console output handle:
INVOKE GetStdHandle, STD_OUTPUT_HANDLE
mov consoleHandle,eax
jump_game_start_again:
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR message, ; string pointer
messageSize, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
;Part of code for generate random number from 0 until 9
mov eax,10 ;get random 0 to 9
call Randomize ;re-seed generator
call RandomRange
mov ranNum,eax ;save random number
;call WriteDec
call Crlf ;new line
;Find a selectedWords base on generate ranNum from manyWords
mov edx, ranNum ;Index
call find_str ;Returns EDI = pointer to string, we pick world
;Copy find world in variable selectedWords
INVOKE Str_copy,
ADDR [edi],
ADDR selectedWords
;Print selectedWords on screen
;mov edx, offset selectedWords
;call WriteString
;call Crlf ;new line
;Make array of dash. It would be world what we guess
call make_array_dash
;Inicialization number of life what you have
mov statusGameLive, 6
again_input_world:
;Print figure depending on the number of lives
call print_hangman_live
;Check if you have more live. If player lost all lives, game is over
cmp statusGameLive, 0
je loop_game_over
mov eax,green+(black*16)
call SetTextColor
mWrite <"Guess a letter: ">
call readChar ;User inputs char
cmp al, 27 ;Check if is press ESC
je exit_main ;YES, end game
cmp al, 32 ;Check if is press SPACE
je restart_game ;YES, restart game
and al, 0DFH ;Convert lowercase input to uppercase.
;If uppercase, it remains uppercase
push eax
sub al, 'A' ;checks if it is a letter
cmp al, 'Z'-'A'
jbe uppercase
jmp again_input_world
uppercase:
pop eax
mov guessLetter, al
call WriteChar
call Crlf ;new line
call Crlf ;new line
mov eax,white+(black*16)
call SetTextColor
;Check if letter is alredy guessed
mov ecx, LENGTHOF guessLetterArray
mov edi, offset guessLetterArray
mov al, guessLetter ; Load character to find
repne scasb ; Search
je loop_guess_letter_exists ; Letter already exist
call make_array_guess_letter
;Check if letter is in selectedWords. If not take life
mov ecx, LENGTHOF selectedWords
mov edi, offset selectedWords
mov al, guessLetter ; Load character to find
repne scasb ; Search
jne loop_take_live ; Letter exist take life
; We are making new array, guess letter whange dash on right pleace
mov esi, offset selectedWords ; Source
mov edi, offset guessWords ; Destination
mov ecx, LENGTHOF selectedWords ; Number of bytes to check
mov al, guessLetter ; Search for that character
xor ebx, ebx ; Index EBX = 0
ride_hard_loop:
cmp [esi+ebx], al ; Compare memory/register
jne @F ; Skip next line if no match
mov [edi+ebx], al ; Hang 'em lower
@@:
inc ebx ; Increment pointer
dec ecx ; Decrement counter
jne ride_hard_loop ; Jump if ECX != 0
;Is there more letter to guess of we finish
mov ecx, LENGTHOF guessWords
mov edi, offset guessWords
mov al, letterDash ; Load character to find
repne scasb ; Search
jne loop_game_win ; No more letter
jmp again_input_world ; Guess next world
exit_main:
INVOKE ExitProcess,0
loop_guess_letter_exists:
mov eax,red+(black*16)
call SetTextColor
mWrite <"Sorry, you alredy guessed letter, ">
mov al, guessLetter
call WriteChar
call Crlf ; new line
mWrite <"I repeat you one more time the letter what you guessed. ">
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mov eax,white+(black*16)
call SetTextColor
jmp again_input_world ; Guess next letter
loop_take_live:
dec statusGameLive
jmp again_input_world ; Guess next letter
restart_game:
INVOKE Str_trim, ADDR guessLetterArray, ','
mov edx, OFFSET guessLetterArray
call StrLength
mov lengthArray, eax
mov edi, offset guessLetterArray ; Destination
add edi, lengthArray
dec edi
;INVOKE Str_trim, ADDR guessLetterArray, guessLetter
INVOKE Str_trim, ADDR guessLetterArray, [edi]
cmp edi, offset guessLetterArray
jne restart_game
;Return white color again
mov eax,white+(black*16)
call SetTextColor
call Crlf ;new line
jmp jump_game_start_again ; Guess next letter
loop_game_win:
mGotoxy 0, 15
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GOODGAME_00, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,green+(black*16)
call SetTextColor
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GOODGAME_01, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,yellow+(black*16)
call SetTextColor
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GOODGAME_02, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,cyan+(black*16)
call SetTextColor
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GOODGAME_03, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,red+(black*16)
call SetTextColor
dec var_loop
cmp var_loop, 0
jne loop_game_win
;restar game after 4*15sekunds
jmp jump_game_start_again
loop_game_over:
mGotoxy 0, 15
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GAMEOVER_00, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,green+(black*16)
call SetTextColor
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GAMEOVER_01, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,yellow+(black*16)
call SetTextColor
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GAMEOVER_02, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,cyan+(black*16)
call SetTextColor
; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_GAMEOVER_03, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
mov eax, drowDelay
call Delay
mGotoxy 0, 15
mov eax,red+(black*16)
call SetTextColor
dec var_loop
cmp var_loop, 0
jne loop_game_over
;restar game after 4*15sekunds
mov eax,white+(black*16)
call SetTextColor
jmp jump_game_start_again
main ENDP
find_str PROC ; ARG: EDX = index
lea edi, manyWords ; Address of string list
mov ecx, len ; Maximal number of bytes to scan
xor al, al ; Scan for 0
@@:
sub edx, 1
jc done ; No index left to scan = string found
repne scasb ; Scan for AL
jmp @B ; Next string
done:
ret
find_str ENDP ; RESULT: EDI pointer to string[edx]
make_array_dash PROC
mov edx,OFFSET selectedWords
call StrLength ; Length of a null-terminated string pointed to by EDX
mov lengthArray,eax
mov al, '-' ; Default charcter for guessWords
mov ecx, lengthArray ; REP counter
mov edi, offset guessWords ; Destination
rep stosb ; Build guessWords
mov BYTE PTR [edi], 0 ; Store the null termination
ret
make_array_dash ENDP
make_array_guess_letter PROC
mov edx, OFFSET guessLetterArray
call StrLength ; Length of a null-terminated string pointed to by EDX
mov lengthArray, eax
mov edi, offset guessLetterArray ; Destination
add edi, lengthArray
mov al, guessLetter
mov BYTE PTR [edi], al ; Store guessLetter
inc edi
mov BYTE PTR [edi], ',' ; Store the null termination
ret
make_array_guess_letter ENDP
print_hangman_live PROC
mov eax, statusGameLive
cmp eax, 6
je live_6
cmp eax, 5
je live_5
cmp eax, 4
je live_4
cmp eax, 3
je live_3
cmp eax, 2
je live_2
cmp eax, 1
je live_1
cmp eax, 0
je live_0
live_6: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ; console output handle
ADDR HANGMAN_LIVES_06, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
live_5: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_LIVES_05, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
live_4: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_LIVES_04, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
live_3: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_LIVES_03, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
live_2: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_LIVES_02, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
live_1: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_LIVES_01, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
live_0: ; Write a string to the console:
INVOKE WriteConsole,
consoleHandle, ;console output handle
ADDR HANGMAN_LIVES_00, ; string pointer
messageSizeGoodGame, ; string length
ADDR bytesWritten, ; returns num bytes written
0 ; not used
call Crlf ; new line
call Crlf ; new line
mov edx, offset guessWords
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
mWrite <"Guessed letter are: ">
mov edx, offset guessLetterArray
call WriteString ; write a string pointed to by EDX
call Crlf ; new line
call Crlf ; new line
ret
print_hangman_live ENDP
END main