From c6167d37cb38ca87f9a0c89803d4cebd59b768e9 Mon Sep 17 00:00:00 2001 From: Paul Gardner-Stephen Date: Thu, 25 Apr 2019 23:04:39 +0930 Subject: [PATCH] token search now basically works. --- c64/basic/basic_main_loop.s | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/c64/basic/basic_main_loop.s b/c64/basic/basic_main_loop.s index 0798111a..ea1b3056 100644 --- a/c64/basic/basic_main_loop.s +++ b/c64/basic/basic_main_loop.s @@ -46,7 +46,7 @@ token_search: ;; tokenise_work1 = offset in line of input ;; tokenise_work2 = length of token we are matching ;; tokenise_work3 = offset in token list - ldy #$00 + lda #$00 sta tokenise_work1 sta tokenise_work3 next_kw_offset: @@ -56,30 +56,30 @@ next_kw_offset: ;; Get count of bytes to compare lda tokenise_work2 sta tokenise_work4 - sta $0427 ;; Load current position - ldx tokenise_work1 ldy tokenise_work3 + ldx tokenise_work1 - ;; Advance offset in compressed token list + ;; Advance offset in compressed token list, and stop at the end inc tokenise_work3 lda tokenise_work3 cmp #$ff bne next_in_match jmp done_searching_for_token -next_in_match: +next_in_match: lda $0100,x cmp packed_keywords,y bne next_kw_offset ;; Advance to next chars in source and target inx iny + dec tokenise_work4 ; Have we compared all bytes yet? + bne next_in_match ;; Keyword matches! inc $d020 - tya ;; We actually point one by late, so rewind to find start of token lda tokenise_work3