1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;; HangMan - An implementation of the Hang Man game in assembly (Emu8086) ;;
5
;; Copyright (C) 2011 Fabien LOISON, Mathilde BOUTIGNY, ;;
6
;; Vincent PEYROUSE and Germain CARR� ;;
8
;; HangMan is free software: you can redistribute it and/or modify ;;
9
;; it under the terms of the GNU General Public License as published by ;;
10
;; the Free Software Foundation, either version 3 of the License, or ;;
11
;; (at your option) any later version. ;;
13
;; This program is distributed in the hope that it will be useful, ;;
14
;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;
15
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;
16
;; GNU General Public License for more details. ;;
18
;; You should have received a copy of the GNU General Public License ;;
19
;; along with this program. If not, see <http://www.gnu.org/licenses/>. ;;
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25
name "hangman" ;Output file name
27
org 0x100 ;Set location counter to 0x100
29
COLS equ 80 ;Terminal width
30
ROWS equ 25 ;Terminal height
34
;================================================================ Main ====
36
;Set the video mode to 80x25, 16 colors, 8 pages
55
;=========================================================== Functions ====
56
;--------------------------------------------------------------------------
71
cmp pos_y, header_height
88
;--------------------------------------------------- _draw_main_menu ------
92
mov pos_x, (80-menuitem_len)/2
93
mov pos_y, header_height
98
mov dx, offset menuitem
100
mov cx, menuitem_numb
113
;Display the arrow on the selected item
114
mov pos_y, header_height
134
;---------------------------------------------------------- _main_menu ----
137
;Move the cursor at the bottom of the screen
142
;Print the help message
144
mov dx, offset menuhelp
162
;Not a valid input... try again ! :p
169
cmp menu_select, menuitem_numb
178
cmp menu_select, 4 ;Exit
189
;====================================================== Main Functions ====
190
;--------------------------------------------------------------- _move ----
191
;Move cursor to (pos_x, pos_y)
202
mov dl, pos_x ; Column
215
;================================================================ Vars ====
225
;=============================================================== Datas ====
227
header db " _ _ ___ __ _ _____ ___ ___ ___ __ _ $"
228
db "| | | | / | | \ | | / ___| / |/ | / | | \ | |$"
229
db "| |_| | / /| | | \| | | | / /| /| | / /| | | \| |$"
230
db "| _ | / /_| | | |\ | | | _ / / |__/ | | / /_| | | |\ |$"
231
db "| | | | / ___ | | | \ | | |_| | / / | | / ___ | | | \ |$"
232
db "|_| |_| /_/ |_| |_| \_| \_____/ /_/ |_| /_/ |_| |_| \_|$"
237
menuhelp db "<Space> Select the next item <Enter> Validate the item$"
238
menuitem db " Single Player$"