can compare strings and output help text when user types HELP
This commit is contained in:
parent
392a70bb39
commit
355a4de559
@ -1,3 +1,3 @@
|
||||
Kernel written in Assmebly
|
||||
I don't really know what I'm doing
|
||||
I am using the MikeOS bootloader (which is why I've got the MikeOS license)
|
||||
Kernel written in Assmebly<br/>
|
||||
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)<br/>
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
source/features/.strings.asm.swp
Normal file
BIN
source/features/.strings.asm.swp
Normal file
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
os_start_cli:
|
||||
pusha
|
||||
|
||||
call os_print_newline
|
||||
|
||||
mov si, prompt
|
||||
call os_print_string
|
||||
@ -19,14 +21,6 @@ os_read_cli:
|
||||
.output_the_user_input:
|
||||
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
|
||||
mov si, user_input
|
||||
mov di, help_string
|
||||
@ -40,10 +34,13 @@ os_read_cli:
|
||||
print_help_text:
|
||||
mov si, help_text
|
||||
call os_print_string_nl
|
||||
call os_read_cli.finish
|
||||
|
||||
|
||||
user_input times 20 db 0
|
||||
prompt db 'CrawOS > ', 0
|
||||
prompt db 'CrawOS: ', 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
|
||||
true db 'TRUE', 0
|
||||
false db 'FALSE', 0
|
||||
|
@ -7,7 +7,7 @@
|
||||
; ^
|
||||
; SI => lodsb loads value stored at SI to AX and then increments SI if DF is 0
|
||||
os_compare_strings:
|
||||
pusha
|
||||
cld
|
||||
|
||||
.compare:
|
||||
lodsb
|
||||
@ -19,10 +19,8 @@ os_compare_strings:
|
||||
|
||||
.unequal:
|
||||
mov cl, 0 ; Change to 0 if unquality is proven
|
||||
popa
|
||||
ret
|
||||
|
||||
.equal:
|
||||
mov cl, 1
|
||||
popa
|
||||
ret
|
||||
|
@ -37,7 +37,7 @@ os_main:
|
||||
je no_change
|
||||
|
||||
no_change:
|
||||
call os_clear_screen
|
||||
call print_help_text
|
||||
call os_start_cli
|
||||
|
||||
bootdev db 0
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user