From e38d1df8071fb877172c078ef80423c8138cfe52 Mon Sep 17 00:00:00 2001 From: Ry Date: Thu, 12 May 2022 17:23:01 -0700 Subject: [PATCH] monitor: Don't allow backspacing past the start of the prompt --- monitor/shell.asm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monitor/shell.asm b/monitor/shell.asm index 453db0e..858aa1a 100644 --- a/monitor/shell.asm +++ b/monitor/shell.asm @@ -56,6 +56,10 @@ monitor_shell_key_down_event_enter: call print_string_to_monitor ret monitor_shell_key_down_event_backspace: + ; check if we are already at the start of the prompt + mov r1, [MONITOR_SHELL_TEXT_BUF_PTR] + cmp r1, MONITOR_SHELL_TEXT_BUF_BOTTOM + iflteq ret ; delete the last character from the screen, and pop the last character from the buffer mov r0, 8 ; backspace character call print_character_to_monitor