2022-04-26 06:46:47 +02:00
|
|
|
; command parser
|
|
|
|
|
|
|
|
; FIXME: thjs is a terrible way to do this
|
|
|
|
monitor_shell_parse_command:
|
|
|
|
mov r0, MONITOR_SHELL_TEXT_BUF_BOTTOM
|
|
|
|
|
|
|
|
; exit
|
|
|
|
mov r1, monitor_shell_exit_command_string
|
|
|
|
call compare_string
|
|
|
|
ifz jmp monitor_shell_exit_command
|
|
|
|
|
|
|
|
; help
|
|
|
|
mov r1, monitor_shell_help_command_string
|
|
|
|
call compare_string
|
|
|
|
ifz jmp monitor_shell_help_command
|
|
|
|
|
2022-05-02 03:03:04 +02:00
|
|
|
; set.8
|
|
|
|
mov r1, monitor_shell_set8_command_string
|
|
|
|
call compare_string
|
|
|
|
ifz jmp monitor_shell_set8_command
|
|
|
|
|
|
|
|
; set.16
|
|
|
|
mov r1, monitor_shell_set16_command_string
|
|
|
|
call compare_string
|
|
|
|
ifz jmp monitor_shell_set16_command
|
|
|
|
|
|
|
|
; set.32
|
|
|
|
mov r1, monitor_shell_set32_command_string
|
|
|
|
call compare_string
|
|
|
|
ifz jmp monitor_shell_set32_command
|
|
|
|
|
2022-04-27 22:41:44 +02:00
|
|
|
; invalid command
|
|
|
|
mov r0, monitor_shell_invalid_command_string
|
|
|
|
call print_string_to_monitor
|
|
|
|
|
2022-04-26 06:46:47 +02:00
|
|
|
ret
|
|
|
|
|
2022-04-27 22:41:44 +02:00
|
|
|
monitor_shell_invalid_command_string: data.str "invalid command" data.8 10 data.8 0
|
|
|
|
|
2022-04-26 06:46:47 +02:00
|
|
|
; all commands
|
|
|
|
#include "monitor/commands/exit.asm"
|
|
|
|
#include "monitor/commands/help.asm"
|
2022-05-02 03:03:04 +02:00
|
|
|
#include "monitor/commands/set.asm"
|