From 66d571ca7db74ae75262795979c4bafaaa427718 Mon Sep 17 00:00:00 2001 From: mgcaret Date: Wed, 4 Nov 2020 20:37:08 -0800 Subject: [PATCH] make dictionary names mixed-case, matching still case-insensitive --- asm/compiler.s | 2 +- asm/interpreter.s | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/asm/compiler.s b/asm/compiler.s index 731fc05..b85fd89 100644 --- a/asm/compiler.s +++ b/asm/compiler.s @@ -88,7 +88,7 @@ nextbank: stz DHERE ; move dictionary pointer to next bank bcs done lda [WR],y and #$7F ; normalize - jsr _cupper ; and convert to upper case + ; jsr _cupper ; and convert to upper case jsr _cbytea iny bne :- diff --git a/asm/interpreter.s b/asm/interpreter.s index 04e1f61..6fc3520 100644 --- a/asm/interpreter.s +++ b/asm/interpreter.s @@ -913,7 +913,7 @@ olp: lda YR beq notfnd ldy #$04 ; offset of length lda [YR],y ; get name length (we pull in two bytes) - and #$7F ; mask in significant bits + and #NAMEMSK ; mask in significant bits cmp XR ; compare to supplied bne snext ; not the right word ; its the right length, compare name @@ -928,8 +928,12 @@ olp: lda YR ldy #$05 ; offset of name clp: lda [WR] ; char in the word we are searching for jsr _cupper8 ; upper case it - cmp [YR],y ; compare to char in definition + pha ; save on stack + lda [YR],y ; compare to char in definition + jsr _cupper8 ; upper case it, too + cmp 1,s ; compare to saved bne xsnext ; no match + pla ; drop char saved on stack iny ; move to next char of name in def rep #SHORT_A jsr _incwr ; move to next char of word we are searching for @@ -951,7 +955,8 @@ clp: lda [WR] ; char in the word we are searching for adc #$00 ; AY=XT sec rts -xsnext: rep #SHORT_A +xsnext: pla ; drop char saved on stack + rep #SHORT_A .a16 ; good habit plx pla