# HG changeset patch # User William Astle # Date 1669093833 25200 # Node ID 4488ed12bb67d72c542164505b8f380be128ece7 # Parent 455cdf81b33af130412bbb96131f932640514827 Fix some logic errors in tokenize routine diff -r 455cdf81b33a -r 4488ed12bb67 src/lwbasic.s --- a/src/lwbasic.s Tue Nov 15 23:37:38 2022 -0700 +++ b/src/lwbasic.s Mon Nov 21 22:10:33 2022 -0700 @@ -1191,7 +1191,7 @@ tokenize clra ; clear "not token" flag clrb ; clear the "in data" flag ldy #tokebuff ; point to destination buffer - pshs d,u ; set return value, the "not token" flag, and the "in data" flag + pshs d,y ; set return value, the "not token" flag, and the "in data" flag tokenize0 lda ,x+ ; get input character bne tokenize1 ; brif not end of input tokenize0a sta ,y+ ; blank out final byte in result @@ -1200,7 +1200,7 @@ subd #tokebuff ; subtract out start; gives length of result puls x,pc ; set return pointer and return tokenize1 tst ,s ; are we in the middle of a "not token"? - beq tokenize2 ; brif not + beq tokenize3a ; brif not bsr setcifalpha ; is it alpha bcs tokenize2 ; brif so - store it and continue bsr setcifdigit ; is it numeric? @@ -1208,7 +1208,7 @@ tokenize2 sta ,y+ ; save output character bra tokenize0 ; check for another tokenize3 clr ,s ; clear the "not token" flag - cmpa #'" ; is it a string? +tokenize3a cmpa #'" ; is it a string? bne tokenize5 ; brif not sta ,y+ ; save string delimiter tokenize4 lda ,x+ ; get input character