Skip to content

Commit

Permalink
sh: del command
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed May 4, 2024
1 parent a6e1109 commit 0305d57
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions applications/sh/commands/commands.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ shell_parse_command:
call compare_string
ifz jmp shell_clear_command

; del
mov r1, shell_del_command_string
call compare_string
ifz jmp shell_del_command

; dir
mov r1, shell_dir_command_string
call compare_string
Expand Down Expand Up @@ -74,6 +79,7 @@ shell_invalid_command_string: data.str "invalid command or FXF binary" data.8 10

; all commands
#include "commands/clear.asm"
#include "commands/del.asm"
#include "commands/dir.asm"
#include "commands/disk.asm"
#include "commands/diskrm.asm"
Expand Down
21 changes: 21 additions & 0 deletions applications/sh/commands/del.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
; del command

shell_del_command_string: data.strz "del"

shell_del_command:
call shell_parse_arguments

mov r3, r0

call get_current_disk_id
mov r1, r0
mov r0, r3
mov r2, shell_type_command_file_struct
call open
cmp r0, 0
ifz jmp shell_type_command_file_not_found

mov r0, shell_type_command_file_struct
call delete

ret
1 change: 1 addition & 0 deletions applications/sh/commands/help.asm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ shell_help_text:
data.str "command | description" data.8 10
data.str "------- | -----------" data.8 10
data.str "clear | clear the terminal contents" data.8 10
data.str "del | delete file $0" 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 "diskrm | remove disk $0" data.8 10
Expand Down

0 comments on commit 0305d57

Please sign in to comment.