rectangles work
This commit is contained in:
54
source/features/cli.asm
Normal file → Executable file
54
source/features/cli.asm
Normal file → Executable file
@@ -6,12 +6,12 @@ os_start_cli:
|
||||
mov si, prompt
|
||||
call os_print_string
|
||||
|
||||
mov ax, 20
|
||||
|
||||
mov di, user_input
|
||||
|
||||
call os_display_input
|
||||
|
||||
popa
|
||||
ret
|
||||
|
||||
; ------------------------------------------------
|
||||
|
||||
@@ -26,21 +26,53 @@ os_read_cli:
|
||||
mov di, help_string
|
||||
call os_compare_strings
|
||||
cmp cl, 1
|
||||
je print_help_text
|
||||
je help
|
||||
|
||||
mov si, user_input
|
||||
mov di, clear_string
|
||||
call os_compare_strings
|
||||
cmp cl, 1
|
||||
je clear
|
||||
|
||||
mov si, user_input
|
||||
mov di, pong_string
|
||||
call os_compare_strings
|
||||
cmp cl, 1
|
||||
je pong
|
||||
|
||||
jmp .unkown
|
||||
|
||||
.unkown:
|
||||
mov si, unknown_command
|
||||
call os_print_string
|
||||
mov si, user_input
|
||||
call os_print_string_nl
|
||||
jmp .finish
|
||||
|
||||
.finish:
|
||||
popa
|
||||
call os_start_cli
|
||||
|
||||
print_help_text:
|
||||
clear:
|
||||
call os_set_text_mode
|
||||
call os_read_cli.finish
|
||||
|
||||
help:
|
||||
mov si, help_text
|
||||
call os_print_string_nl
|
||||
call os_read_cli.finish
|
||||
|
||||
pong:
|
||||
call game_pong
|
||||
call os_read_cli.finish
|
||||
|
||||
user_input times 20 db 0
|
||||
prompt db 'CrawOS: ', 0
|
||||
help_string db 'HELP', 0
|
||||
help_text db 'This is CrawOS, type "HELP" for help', 0
|
||||
command_result_text db 'You typed: ', 0
|
||||
true db 'TRUE', 0
|
||||
false db 'FALSE', 0
|
||||
section .data
|
||||
user_input times 20 db 0
|
||||
prompt_length db 20
|
||||
prompt db 'CrawOS: ', 0
|
||||
help_string db 'HELP', 0
|
||||
clear_string db 'CLEAR', 0
|
||||
pong_string db 'PONG', 0
|
||||
help_text db 'This is CrawOS, type "HELP" for help, "CLEAR" to clear the screen', 0
|
||||
command_result_text db 'You typed: ', 0
|
||||
unknown_command db 'Error: Unkown Command.. ', 0
|
||||
|
Reference in New Issue
Block a user