can compare strings and output help text when user types HELP

This commit is contained in:
DeaDvey 2025-06-07 15:42:27 +01:00
parent 392a70bb39
commit 355a4de559
10 changed files with 12 additions and 17 deletions

View File

@ -1,3 +1,3 @@
Kernel written in Assmebly Kernel written in Assmebly<br/>
I don't really know what I'm doing I don't really know what I'm doing<br/>
I am using the MikeOS bootloader (which is why I've got the MikeOS license) I am using the MikeOS bootloader (which is why I've got the MikeOS license)<br/>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,8 @@
os_start_cli: os_start_cli:
pusha pusha
call os_print_newline
mov si, prompt mov si, prompt
call os_print_string call os_print_string
@ -19,14 +21,6 @@ os_read_cli:
.output_the_user_input: .output_the_user_input:
call os_print_newline call os_print_newline
mov si, command_result_text
call os_print_string
mov si, user_input
call os_print_string
call os_print_newline
.check_matches: ; Check if the user input matches any internal commands .check_matches: ; Check if the user input matches any internal commands
mov si, user_input mov si, user_input
mov di, help_string mov di, help_string
@ -40,10 +34,13 @@ os_read_cli:
print_help_text: print_help_text:
mov si, help_text mov si, help_text
call os_print_string_nl call os_print_string_nl
call os_read_cli.finish
user_input times 20 db 0 user_input times 20 db 0
prompt db 'CrawOS > ', 0 prompt db 'CrawOS: ', 0
help_string db 'HELP', 0 help_string db 'HELP', 0
help_text db 'This is CrawOS', 0 help_text db 'This is CrawOS, type "HELP" for help', 0
command_result_text db 'You typed: ', 0 command_result_text db 'You typed: ', 0
true db 'TRUE', 0
false db 'FALSE', 0

View File

@ -7,7 +7,7 @@
; ^ ; ^
; SI => lodsb loads value stored at SI to AX and then increments SI if DF is 0 ; SI => lodsb loads value stored at SI to AX and then increments SI if DF is 0
os_compare_strings: os_compare_strings:
pusha cld
.compare: .compare:
lodsb lodsb
@ -19,10 +19,8 @@ os_compare_strings:
.unequal: .unequal:
mov cl, 0 ; Change to 0 if unquality is proven mov cl, 0 ; Change to 0 if unquality is proven
popa
ret ret
.equal: .equal:
mov cl, 1 mov cl, 1
popa
ret ret

View File

@ -37,7 +37,7 @@ os_main:
je no_change je no_change
no_change: no_change:
call os_clear_screen call print_help_text
call os_start_cli call os_start_cli
bootdev db 0 bootdev db 0

Binary file not shown.