From fd612be2213c46335ab684e66ad22cfda7855fb6 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Fri, 26 Apr 2019 23:31:08 +0930 Subject: [PATCH] replace keywords with correct tokens in tokeniser --- c64/basic/tokenise_line.s | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/c64/basic/tokenise_line.s b/c64/basic/tokenise_line.s index 21d994be..33cb1ea1 100644 --- a/c64/basic/tokenise_line.s +++ b/c64/basic/tokenise_line.s @@ -208,12 +208,32 @@ next_in_match: word_boundary: ;; Found a token whose offset is in tokenise_work3 - ;; No trace back to the start of the compressed keyword list - ;; to work out what word number we are, so that we can return + ;; Now trace back to the start of the compressed keyword list + ;; to work out what keyword number we are, so that we can return ;; the token number. inc $d020 - lda #$80 ; Pretend token + ldy #$80 + + stx $0427 +token_count_loop: + lda packed_keywords,x + cmp #$fe + bne + + iny +* + and #$0f + cmp #$00 + bne + + iny +* + cpx #$00 + beq + + dex + jmp token_count_loop +* + + tya clc rts