begin parsing line numbers at start of lines
This commit is contained in:
1 parent
1325f31010
commit
26ca54660a
2 files changed
+28
-3
No files matched your search
@@ -45,13 +45,38 @@ rsl_l1: lda $0200,x
|
|||||||
;; Stop trying to rim if we run out of input
|
;; Stop trying to rim if we run out of input
|
||||||
bne remove_leading_spaces
|
bne remove_leading_spaces
|
||||||
*
|
*
|
||||||
|
|
||||||
;; Do printing of the new line
|
;; Do printing of the new line
|
||||||
lda #$0d
|
lda #$0d
|
||||||
jsr $ffd2
|
jsr $ffd2
|
||||||
|
|
||||||
jsr tokenise_line
|
jsr tokenise_line
|
||||||
|
|
||||||
|
;; Has the user entered a line of BASIC beginning with a number?
|
||||||
|
lda $0200
|
||||||
|
cmp #$30
|
||||||
|
bcc not_a_line
|
||||||
|
cmp #$39
|
||||||
|
bcs not_a_line
|
||||||
|
|
||||||
|
;; Yes, the line begins with a number.
|
||||||
|
;; Parse the line number and check validity
|
||||||
|
inc $d020
|
||||||
|
|
||||||
|
;; injest_number follows tokenise_work1 as the offset into the line,
|
||||||
|
;; so remember the line length somewhere else for now.
|
||||||
|
lda tokenise_work1
|
||||||
|
sta tokenise_work2
|
||||||
|
lda #$00
|
||||||
|
sta tokenise_work1
|
||||||
|
|
||||||
|
jsr injest_number
|
||||||
|
|
||||||
|
lda tokenise_work1
|
||||||
|
sta $0427
|
||||||
|
|
||||||
|
|
||||||
|
not_a_line:
|
||||||
|
|
||||||
jsr ready_message
|
jsr ready_message
|
||||||
|
|
||||||
jmp basic_main_loop
|
jmp basic_main_loop
|
||||||
@@ -17,7 +17,7 @@ injest_number:
|
|||||||
|
|
||||||
;; Clear decimal position flag
|
;; Clear decimal position flag
|
||||||
lda #$ff
|
lda #$ff
|
||||||
sta tokenise_work2
|
sta tokenise_work4
|
||||||
|
|
||||||
;; Check if leading char is a - sign
|
;; Check if leading char is a - sign
|
||||||
;; Note: the - will have been tokenised to $AB
|
;; Note: the - will have been tokenised to $AB
|
||||||
@@ -44,7 +44,7 @@ ij_loop1:
|
|||||||
;; If we have seen a decimal point, then we can completely ignore
|
;; If we have seen a decimal point, then we can completely ignore
|
||||||
;; the digit, as it is contributing not recordable information
|
;; the digit, as it is contributing not recordable information
|
||||||
|
|
||||||
lda tokenise_work2
|
lda tokenise_work4
|
||||||
cmp #$ff
|
cmp #$ff
|
||||||
bne ij_seen_decimal_point
|
bne ij_seen_decimal_point
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user