remove debug output from tokeniser
This commit is contained in:
1 parent
eedf82f1fd
commit
11392d883c
2 files changed
+1
-54
No files matched your search
@@ -26,23 +26,9 @@ pack_word:
|
||||
;; is incomplete, which is important for searching for abbreviated
|
||||
;; key words.)
|
||||
|
||||
stx $0441
|
||||
|
||||
ldx #$0f
|
||||
lda #$20
|
||||
*
|
||||
sta $0658,x
|
||||
dex
|
||||
bpl -
|
||||
|
||||
ldx $0441
|
||||
|
||||
lda #$00
|
||||
sta $043f
|
||||
|
||||
;; Make sure we have a sane request
|
||||
lda tokenise_work1
|
||||
sta $0440
|
||||
bne +
|
||||
sec
|
||||
rts
|
||||
@@ -54,8 +40,6 @@ pack_word:
|
||||
|
||||
pack_char_loop:
|
||||
|
||||
inc $043f
|
||||
|
||||
;; Get the next char
|
||||
lda $0200,x
|
||||
|
||||
@@ -204,9 +188,6 @@ nothing_to_flush:
|
||||
|
||||
consider_next_char:
|
||||
;; Pack next char
|
||||
lda tokenise_work1
|
||||
sta $0680,x
|
||||
inc $0658,x
|
||||
inx
|
||||
dec tokenise_work1
|
||||
bne pack_char_loop
|
||||
|
||||
@@ -24,16 +24,11 @@ tokenise_char:
|
||||
|
||||
;; Check if we have reached end of the line?
|
||||
lda $0110
|
||||
tax
|
||||
inc $0400,x
|
||||
cmp $0113
|
||||
bne +
|
||||
|
||||
;; End of line reached
|
||||
|
||||
ldx #0
|
||||
stx $0450
|
||||
|
||||
;; Finished tokenising line
|
||||
;; Update tokenise_work1 and terminate with null
|
||||
ldx $0112
|
||||
@@ -43,8 +38,6 @@ tokenise_char:
|
||||
rts
|
||||
*
|
||||
;; More to do
|
||||
ldx #1
|
||||
stx $0450
|
||||
|
||||
;; Maximum keyword length
|
||||
lda #7
|
||||
@@ -55,20 +48,11 @@ tokenise_char_loop:
|
||||
;; Returns packed length in tokenise_work2 and writes the packed
|
||||
;; word at $0100+
|
||||
|
||||
ldx #2
|
||||
stx $0450
|
||||
|
||||
;; Pack string
|
||||
ldx $0110
|
||||
stx $044e
|
||||
lda $0111
|
||||
sta tokenise_work1
|
||||
bpl +
|
||||
foo: inc $d020
|
||||
jmp foo
|
||||
|
||||
*
|
||||
sta $044f
|
||||
|
||||
jsr pack_word
|
||||
lda tokenise_work2
|
||||
cmp #$10
|
||||
@@ -78,31 +62,16 @@ foo: inc $d020
|
||||
jmp do_basic_error
|
||||
*
|
||||
|
||||
ldx #3
|
||||
stx $0450
|
||||
|
||||
;; Search for it in keywords
|
||||
jsr keyword_search
|
||||
|
||||
ldx #4
|
||||
stx $0450
|
||||
|
||||
;; Did we find a keyword?
|
||||
bcc found_token_in_line
|
||||
|
||||
ldx #5
|
||||
stx $0450
|
||||
|
||||
;; Nope, so try shorter
|
||||
ldx $0111
|
||||
stx $044d
|
||||
inc $0608,x
|
||||
dec $0111
|
||||
bne tokenise_char_loop
|
||||
|
||||
ldx #6
|
||||
stx $0450
|
||||
|
||||
;; Is not a token, so copy to output verbatim
|
||||
ldx $0110
|
||||
ldy $0112
|
||||
@@ -116,9 +85,6 @@ foo: inc $d020
|
||||
|
||||
found_token_in_line:
|
||||
|
||||
ldx #7
|
||||
stx $0450
|
||||
|
||||
;; Got a token, so write it out
|
||||
ldx $0112
|
||||
sta $0200,x
|
||||
|
||||
Reference in new issue
Block a user