diff --git a/README.md b/README.md index 898a494..bce613c 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Missing features - Ability to set the seed manually - Hard and extra hard modes -- In-program help Word lists ---------- diff --git a/dosdl.asm b/dosdl.asm index e2bd351..65c4719 100644 --- a/dosdl.asm +++ b/dosdl.asm @@ -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"