changeset 30:e57518b96c15

Make command parser case insensitive Now that full ASCII is supported, it makes sense to make command parsing case insensitive.
author William Astle <lost@l-w.ca>
date Fri, 02 Jan 2015 17:47:58 -0700
parents eacb6679cbf4
children 15236650550d
files dod.s
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dod.s	Fri Jan 02 17:40:04 2015 -0700
+++ b/dod.s	Fri Jan 02 17:47:58 2015 -0700
@@ -2256,6 +2256,12 @@
 		bra lookup_word000		; go look up keyword
 ; Look up the word at the start of the line  against the keyword list in X. Each keyword list has a prefix byte containing
 ; additional flags, etc.
+toupper		cmpb #'a			; is it below lowercase A?
+		blo toupper000			; brif so - no change
+		cmpb #'z			; is it above lowercase Z?
+		bhi toupper000			; brif so
+		subb #$20			; make it uppercase
+toupper000	rts
 lookup_word	pshs a,b,x,y,u			; save registers
 		clra				; initialize keyword number
 		clrb				; flag for no match
@@ -2269,6 +2275,7 @@
 		ldu #wordbuff			; point to start of parsed word
 lookup_word002	ldb ,u+				; fetch input character
 		beq lookup_word004		; brif end of input
+		bsr toupper			; make it upper case
 		cmpb ,y+			; does it match?	
 		bne lookup_word005		; brif it doesn't match
 		tst ,y				; end of keyword?