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