comparison src/parse.s @ 125:0607e4e20702

Correct offset error for keyword table lookup
author William Astle <lost@l-w.ca>
date Sun, 07 Jan 2024 20:35:51 -0700
parents 8770e6f977c3
children ac183a519439
comparison
equal deleted inserted replaced
124:8770e6f977c3 125:0607e4e20702
146 parse_wordtab pshs a,x ; save input character and start of table 146 parse_wordtab pshs a,x ; save input character and start of table
147 ldd ,x++ ; get length of this table 147 ldd ,x++ ; get length of this table
148 addd 1,s ; calculate the address of the end of the table 148 addd 1,s ; calculate the address of the end of the table
149 std 1,s ; save end address for comparison later 149 std 1,s ; save end address for comparison later
150 lda ,s ; get back input character 150 lda ,s ; get back input character
151 parse_wordtab1 ldb -1,x ; fetch token code for this entry 151 parse_wordtab1 ldb 1,x ; fetch token code for this entry
152 cmpa ,x++ ; does this entry match? 152 cmpa ,x++ ; does this entry match?
153 bne parse_wordtab4 ; brif not 153 bne parse_wordtab4 ; brif not
154 cmpb #token_eot ; is it indicating a sub table? 154 cmpb #token_eot ; is it indicating a sub table?
155 bne parse_wordtab6 ; brif not 155 bne parse_wordtab6 ; brif not
156 bsr parse_nextcharu ; fetch next input character (for sub table match) 156 bsr parse_nextcharu ; fetch next input character (for sub table match)