refactor end of statement check.

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-29 22:27:58 +09:30
1 parent 3bdfa8f834
commit 270314640c
2 files changed
+14 -5

No files matched your search

+10 -5
View File
@@ -2,7 +2,7 @@
;; after first checking that we have a colon
;; or $00 char
basic_run_next_statement:
basic_end_of_statement_check:
ldx #<basic_current_statement_ptr
ldy #0
jsr peek_under_roms
@@ -12,11 +12,16 @@ basic_run_next_statement:
cmp #$3a
beq +
;; Nope, so SYNTAX ERROR it is!
ldx #10
jmp do_basic_error
;; not end of statement
clc
rts
*
sec
rts
basic_run_next_statement:
jsr basic_end_of_statement_check
bcc basic_execute_line
;; Go through the line until its end is reached.
;; If we reach the end are in direct mode, then
+4
View File
@@ -1,6 +1,10 @@
cmd_run:
;; XXX - Parse starting line number
jsr basic_end_of_statement_check
bcc +
*
;; Reset line pointer to first line of program.
lda basic_start_of_text_ptr+0
sta basic_current_line_ptr+0