allow multiple statements on single line. Issue #14
This commit is contained in:
1 parent
3a58c781c7
commit
b15ddafa6a
3 files changed
+40
-3
No files matched your search
@@ -1,10 +1,30 @@
|
||||
;; Jump back into the BASIC execute line loop
|
||||
;; after first checking that we have a colon
|
||||
;; or $00 char
|
||||
|
||||
basic_run_next_statement:
|
||||
ldx #<basic_current_statement_ptr
|
||||
ldy #0
|
||||
jsr peek_under_roms
|
||||
|
||||
cmp #$00
|
||||
beq +
|
||||
cmp #$3a
|
||||
beq +
|
||||
|
||||
;; Nope, so SYNTAX ERROR it is!
|
||||
ldx #10
|
||||
jmp do_basic_error
|
||||
|
||||
*
|
||||
|
||||
;; Go through the line until its end is reached.
|
||||
;; If we reach the end are in direct mode, then
|
||||
;; go back to reading input, else look for the
|
||||
;; next line, and advance to that, or else
|
||||
;; return to READY prompt because we have run out
|
||||
;; of program.
|
||||
|
||||
|
||||
basic_execute_line:
|
||||
|
||||
;; Get next char of program text, even if it is hiding under a ROM or the
|
||||
@@ -26,6 +46,10 @@ basic_execute_line:
|
||||
pha
|
||||
lda basic_command_jump_table+0,x
|
||||
pha
|
||||
|
||||
;; Now consume the character
|
||||
jsr basic_consume_character
|
||||
|
||||
rts
|
||||
|
||||
not_a_token:
|
||||
@@ -46,11 +70,16 @@ not_a_token:
|
||||
jmp basic_main_loop
|
||||
|
||||
basic_skip_char:
|
||||
jsr basic_consume_character
|
||||
jmp basic_execute_line
|
||||
|
||||
basic_consume_character:
|
||||
;; Advance basic text pointer
|
||||
inc basic_current_statement_ptr+0
|
||||
bne +
|
||||
inc basic_current_statement_ptr+1
|
||||
* jmp basic_execute_line
|
||||
*
|
||||
rts
|
||||
|
||||
basic_end_of_line:
|
||||
|
||||
|
||||
Reference in new issue
Block a user