Add in-program help

This commit is contained in:
Juhani Krekelä 2022-02-25 00:04:10 +02:00
parent c538bd04f7
commit d157d8352b
2 changed files with 39 additions and 1 deletions

View File

@ -18,7 +18,6 @@ Missing features
- Ability to set the seed manually
- Hard and extra hard modes
- In-program help
Word lists
----------

View File

@ -3,8 +3,26 @@ cpu 8086
org 0x100
args_length equ 0x80
args_area equ 0x81
section .code
parse_arguments:
; TODO: Implement argument parsing
xor ch, ch
mov cl, [args_length]
test cx, cx
jz seed_rng_date
print_help:
mov ah, 9
mov dx, help_str
int 0x21
ret
seed_rng_date:
; Get date
mov ah, 0x2a
@ -68,6 +86,11 @@ load_target:
cmp byte [target], '{'
je select_target
print_greeting:
mov ah, 9
mov dx, greeting_str
int 0x21
read_guess:
; Number of thus far guessed letters stored in bx
xor bx, bx
@ -775,6 +798,8 @@ day db 0
section .rodata
greeting_str db 'Welcome to hello DOSdl. Run `dosdl /?` for help.', 13, 10, '$'
space_dash_space_str db ' - $'
not_found_str db 'word not found$'
erase_word_str db ' $'
@ -783,5 +808,19 @@ correct_in_str db 'Correct in $'
guesses_str db ' guesses.$'
guess_str db ' guess.$'
help_str:
db 'Usage: dosdl', 13, 10
db 13, 10
db 'Hello DOSdl is a word guessing game. You have six tries to guess the correct', 13, 10
db 'English word. After a guess the game displays feedback under each letter:', 13, 10
db 13, 10
db "' ' Letter is in the correct place.", 13, 10
db "'^' Letter is in the wrong place.", 13, 10
db "'x' Letter is not in used in the word, or its uses are already covered by the", 13, 10
db ' above cases.', 13, 10
db 13, 10
db 'After the feedback, the game shows a list of letters that have not yet been', 13, 10
db 'ruled out.$'
%include "dictionary.inc"
%include "targets.inc"