summaryrefslogtreecommitdiff
path: root/programs/sub-suite/lexer.s
diff options
context:
space:
mode:
Diffstat (limited to 'programs/sub-suite/lexer.s')
-rw-r--r--programs/sub-suite/lexer.s18
1 files changed, 8 insertions, 10 deletions
diff --git a/programs/sub-suite/lexer.s b/programs/sub-suite/lexer.s
index b2850aa..0d712ff 100644
--- a/programs/sub-suite/lexer.s
+++ b/programs/sub-suite/lexer.s
@@ -65,7 +65,7 @@ lex:
;@nextlline:
; ldb #1 ; No, so set the second pointer to the last line.
; jsr set_ptr ;
-; ldy #ln.next ; Set the next last line to the current line.
+; ldy #line.next ; Set the next last line to the current line.
; lda.q cline ;
; sta.q (ptr2), y ;
; bra @initline ; Initialize the line.
@@ -76,11 +76,11 @@ lex:
; ldb #1 ; Set the second pointer to the current line.
; jsr set_ptr ;
; and #0 ; Reset A.
-; ldy #ln.next ; Reset the next line.
+; ldy #line.next ; Reset the next line.
; sta.q (ptr2), y ;
-; ldy #ln.tok ; Reset the token.
+; ldy #line.tok ; Reset the token.
; sta.q (ptr2), y ;
-; ldy #ln.bline ; Reset the number of blank lines.
+; ldy #line.bline ; Reset the number of blank lines.
; sta.w (ptr2), y ;
; tay ; Reset Y.
@loop:
@@ -225,11 +225,10 @@ ptok_dot:
beq @found ; Yes, so create a new token.
inc idx1 ; No, so increment the directive ID.
@getlen:
+ mov d, a ; Get the string.
jsr strlen ; Get the string's length.
inc ; Add one to the length.
- clc ; Prepare for a non carrying add.
- adc.w idx2 ; Add the string offset to the current length
- sta.w idx2 ; Save the offset in the third index.
+ add.w idx2, a ; Add the string offset to the current length
bra @dir_loop ; Keep looping.
@found:
lda #TOK_DIR ; Set the lexeme type to TOK_DIR.
@@ -443,11 +442,10 @@ ptok_alph:
beq @found ; Yes, so create a new token.
inc idx1 ; No, so increment the instruction ID.
@offset:
+ mov d, a ; Get the string.
jsr strlen ; Get the string's length.
inc ; Add one to the length.
- clc ; Prepare for a non carrying add.
- adc.w idx2 ; Add the string offset to the current length
- sta.w idx2 ; Save the offset in the third index.
+ add.w idx2, a ; Add the string offset to the current length
bra @isop_loop ; Keep looping.
@found:
lda #TOK_MNE ; Set the lexeme type to TOK_MNE.