From 3943b5502a5ae7212220dd0a8570bda9fd4f71a0 Mon Sep 17 00:00:00 2001 From: Gale Faraday Date: Tue, 14 Oct 2025 16:51:31 -0500 Subject: [PATCH] feat(buzbee): made BUZBEE command line case insensitive --- src/buzbee.s | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/buzbee.s b/src/buzbee.s index 6625b01..7ecf063 100644 --- a/src/buzbee.s +++ b/src/buzbee.s @@ -40,13 +40,14 @@ BBVAR tagbbvar EXPORT BUZBEE BUZBEE - lbsr NEWLINE ; Setup the new input line and handle display. - bsr INPLOOP ; Fill input buffer. - cmpy #0 ; No data? - beq BUZBEE ; Try again... - lbsr TOKENIZE ; Try to tokenize the input buffer - lbsr RUNIF ; Execute token buffer, handling any errors - bra BUZBEE ; Repeat + lbsr NEWLINE ; Setup the new input line and handle display. + bsr INPLOOP ; Fill input buffer. + cmpy #0 ; No data? + beq BUZBEE ; Try again... + lbsr MKINSENSITIVE ; Make the input buffer case insensitive + lbsr TOKENIZE ; Try to tokenize the input buffer + lbsr RUNIF ; Execute token buffer, handling any errors + bra BUZBEE ; Repeat ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; @@ -127,6 +128,21 @@ NEXT@ ldy #0 ; Reset buffer fill pointer rts +; Makes the input buffer case insensitive +MKINSENSITIVE +NEXTC@ + lda BBVAR.input,x + cmpa #'z ; Is the char outside the lowercase range? + bhi NOTLCASE@ ; Yes? Skip offset part + cmpa #'a ; Again on the other side of the range + blo NOTLCASE@ + anda #$DF ; -32 +NOTLCASE@ + leax 1,x ; Ready next char + cmpx BBVAR.cchinput ; Are we at the end? + bne NEXTC@ ; No? Loop + rts + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Hex Conversion and Printing Routines