sh: Add rdall
command
This commit is contained in:
parent
3870289252
commit
7a2f96717e
|
@ -36,6 +36,11 @@ shell_parse_command:
|
|||
call compare_string
|
||||
ifz jmp shell_help_command
|
||||
|
||||
; rdall
|
||||
mov r1, shell_rdall_command_string
|
||||
call compare_string
|
||||
ifz jmp shell_rdall_command
|
||||
|
||||
; rdnext
|
||||
mov r1, shell_rdnext_command_string
|
||||
call compare_string
|
||||
|
@ -69,6 +74,7 @@ shell_invalid_command_string: data.str "invalid command or FXF binary" data.8 10
|
|||
#include "commands/diskrm.asm"
|
||||
#include "commands/exit.asm"
|
||||
#include "commands/help.asm"
|
||||
#include "commands/rdall.asm"
|
||||
#include "commands/rdnext.asm"
|
||||
#include "commands/shutdown.asm"
|
||||
#include "commands/type.asm"
|
||||
|
|
|
@ -22,6 +22,7 @@ shell_help_text:
|
|||
data.str "diskrm | remove disk $0" data.8 10
|
||||
data.str "exit | exit the shell" 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 "rdnext | redirect the next command's IO" data.8 10
|
||||
data.str "shutdown| turn the computer off" data.8 10
|
||||
data.str "type | print contents of file $0" data.8 10
|
||||
|
|
26
applications/sh/commands/rdall.asm
Normal file
26
applications/sh/commands/rdall.asm
Normal file
|
@ -0,0 +1,26 @@
|
|||
; rdall command
|
||||
|
||||
shell_rdall_command_string: data.strz "rdall"
|
||||
|
||||
shell_rdall_command:
|
||||
call shell_parse_arguments
|
||||
push r0
|
||||
call get_current_disk_id
|
||||
mov r1, r0
|
||||
pop r0
|
||||
mov r2, shell_redirect_stream_struct
|
||||
call open
|
||||
cmp r0, 0
|
||||
ifz jmp shell_rdall_command_failed_to_open
|
||||
|
||||
mov.8 [shell_redirect_next], 0
|
||||
mov [shell_stream_struct_ptr], shell_redirect_stream_struct
|
||||
|
||||
ret
|
||||
|
||||
shell_rdall_command_failed_to_open:
|
||||
mov r0, shell_rdnext_command_failed_to_open_string
|
||||
call print_str_to_terminal
|
||||
ret
|
||||
|
||||
shell_rdall_command_failed_to_open_string: data.str "failed to open file/stream for redirect" data.8 10 data.8 0
|
|
@ -26,4 +26,4 @@ shell_rdnext_command_failed_to_open:
|
|||
call print_str_to_terminal
|
||||
ret
|
||||
|
||||
shell_rdnext_command_failed_to_open_string: data.str "failed to open file for redirect" data.8 10 data.8 0
|
||||
shell_rdnext_command_failed_to_open_string: data.str "failed to open file/stream for redirect" data.8 10 data.8 0
|
||||
|
|
Loading…
Reference in New Issue
Block a user