From cfe570c531c57a14e1fa185f020dc135e8809312 Mon Sep 17 00:00:00 2001 From: deadvey Date: Sat, 14 Feb 2026 16:04:57 +0000 Subject: [PATCH] Fixed an issue with the input where you can't backspace properly --- data/fb.bas | 9 +++++++++ data/hello.bas | 20 ++++++++++++++++---- source/kernel/features/keyboard.asm | 6 +++--- 3 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 data/fb.bas diff --git a/data/fb.bas b/data/fb.bas new file mode 100644 index 0000000..4884acb --- /dev/null +++ b/data/fb.bas @@ -0,0 +1,9 @@ +FOR A = 1 TO 100 +PRINT A ; +B = A % 3 +C = A % 5 +IF B = 0 then PRINT "Fizz" ; +IF C = 0 then PRINT "Buzz" ; +PRINT "" +NEXT A +END diff --git a/data/hello.bas b/data/hello.bas index 9aa0273..5012fa4 100644 --- a/data/hello.bas +++ b/data/hello.bas @@ -1,5 +1,17 @@ -PRINT "What's your name?" -INPUT $1 -PRINT "Hello " ; -PRINT $1 +$1 = "_________" +A = & $1 +FOR X = 1 TO 9 +FOR Y = 1 TO 9 +PEEK B A +IF B = 95 THEN PRINT "_" ; +IF B = 88 THEN PRINT "X" ; +IF B = 79 THEN PRINT "O" ; +C = A % 3 +IF C = 0 THEN PRINT " " +A = A + 1 +NEXT Y +Z = X % 2 +IF Z = 0 THEN PRINT "You are X" +IF Z = 1 THEN PRINT "You are O" +NEXT X END diff --git a/source/kernel/features/keyboard.asm b/source/kernel/features/keyboard.asm index 18f75e2..ad5e112 100644 --- a/source/kernel/features/keyboard.asm +++ b/source/kernel/features/keyboard.asm @@ -57,8 +57,8 @@ keyboard_display_input: ret ; Return to the parent function (whatever that may be) .backspace: - call .move_cursor_back ; then .move_cursor_back - call .loop ; Else .loop + jmp .move_cursor_back ; then .move_cursor_back + jmp .loop ; Else .loop .move_cursor_back: mov ah, 0Eh @@ -71,7 +71,7 @@ keyboard_display_input: int 10h dec di - jmp keyboard_display_input + jmp .loop .print_current_input: ; Echo back that character and return the key inputing stosb