sh: Add echo command

This commit is contained in:
Ry 2023-04-02 13:17:54 -07:00
parent 7a2f96717e
commit f6ec0dde0b
3 changed files with 18 additions and 0 deletions

View File

@ -26,6 +26,11 @@ shell_parse_command:
call compare_string call compare_string
ifz jmp shell_diskrm_command ifz jmp shell_diskrm_command
; echo
mov r1, shell_echo_command_string
call compare_string
ifz jmp shell_echo_command
; exit ; exit
mov r1, shell_exit_command_string mov r1, shell_exit_command_string
call compare_string call compare_string
@ -72,6 +77,7 @@ shell_invalid_command_string: data.str "invalid command or FXF binary" data.8 10
#include "commands/dir.asm" #include "commands/dir.asm"
#include "commands/disk.asm" #include "commands/disk.asm"
#include "commands/diskrm.asm" #include "commands/diskrm.asm"
#include "commands/echo.asm"
#include "commands/exit.asm" #include "commands/exit.asm"
#include "commands/help.asm" #include "commands/help.asm"
#include "commands/rdall.asm" #include "commands/rdall.asm"

View File

@ -0,0 +1,11 @@
; clear command
shell_echo_command_string: data.strz "echo"
shell_echo_command:
mov r0, [shell_args_ptr]
call print_str_to_terminal
mov r0, 10
call print_character_to_terminal
ret

View File

@ -20,6 +20,7 @@ shell_help_text:
data.str "dir | show contents of selected disk" data.8 10 data.str "dir | show contents of selected disk" data.8 10
data.str "disk | select disk $0" data.8 10 data.str "disk | select disk $0" data.8 10
data.str "diskrm | remove disk $0" data.8 10 data.str "diskrm | remove disk $0" data.8 10
data.str "echo | print the specified text" data.8 10
data.str "exit | exit the shell" data.8 10 data.str "exit | exit the shell" data.8 10
data.str "help | show this help text" data.8 10 data.str "help | show this help text" data.8 10
data.str "rdall | redirect all IO to $0" data.8 10 data.str "rdall | redirect all IO to $0" data.8 10