Mercurial > hg > index.cgi
changeset 30:4488ed12bb67
Fix some logic errors in tokenize routine
author | William Astle <lost@l-w.ca> |
---|---|
date | Mon, 21 Nov 2022 22:10:33 -0700 |
parents | 455cdf81b33a |
children | e74a975b38d9 |
files | src/lwbasic.s |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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