fix some problems with token searching

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-25 22:37:00 +09:30
1 parent 3892503289
commit 04e5dd326f
2 files changed
+11 -8

No files matched your search

+6
View File
@@ -80,11 +80,17 @@ next_in_match:
;; Keyword matches! ;; Keyword matches!
inc $d020 inc $d020
tya tya
;; We actually point one by late, so rewind to find start of token
lda tokenise_work3
sec
sbc #$01
clc clc
adc #<packed_keywords adc #<packed_keywords
sta temp_string_ptr+0 sta temp_string_ptr+0
lda #>packed_keywords lda #>packed_keywords
sta temp_string_ptr+1 sta temp_string_ptr+1
;; Print the token we found
jsr print_packed_string jsr print_packed_string
done_searching_for_token: done_searching_for_token:
+5 -8
View File
@@ -91,8 +91,7 @@ write_literal_and_terminate_if_required:
lda $0200,x lda $0200,x
jsr write_unpacked_char jsr write_unpacked_char
jsr end_string_if_required jmp end_string_if_required
jmp consider_next_char
end_string_if_required: end_string_if_required:
;; Check if X points to last char of string to be packed ;; Check if X points to last char of string to be packed
@@ -100,7 +99,7 @@ end_string_if_required:
cpx tokenise_work1 cpx tokenise_work1
beq + beq +
dex dex
rts jmp consider_next_char
* *
dex dex
;; Fall through ;; Fall through
@@ -154,10 +153,8 @@ stored_nybl:
inc tokenise_work2 inc tokenise_work2
;; Add termination byte if required ;; Add termination byte if required
;; (This re-writes the same byte again, which we don't care about ;; (This re-writes the same byte again, which we don't care about)
jsr end_string_if_required jmp end_string_if_required
jmp consider_next_char
whole_byte_symbol: whole_byte_symbol:
;; It's a $Fx symbol. ;; It's a $Fx symbol.
@@ -181,7 +178,7 @@ nothing_to_flush:
;; if it has been passed to us via fall-through ;; if it has been passed to us via fall-through
jsr write_unpacked_char jsr write_unpacked_char
jsr end_string_if_required jmp end_string_if_required
consider_next_char: consider_next_char:
;; Pack next char ;; Pack next char