implement RUN command. Show line number in errors when in program mode.

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-29 22:20:02 +09:30
1 parent 995dc52967
commit 7c960fd6b4
3 files changed
+23 -1

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
cmd_run:
;; XXX - Parse starting line number
;; Reset line pointer to first line of program.
lda basic_start_of_text_ptr+0
sta basic_current_line_ptr+0
lda basic_start_of_text_ptr+1
sta basic_current_line_ptr+1
;; Run it!
jmp basic_execute_from_current_line
-1
View File
@@ -10,7 +10,6 @@ cmd_dim:
cmd_read:
cmd_let:
cmd_goto:
cmd_run:
cmd_if:
cmd_restore:
cmd_gosub:
+12
View File
@@ -22,6 +22,18 @@ do_basic_error:
ldx #33
jsr print_packed_message
lda basic_current_line_number+1
cmp #$ff
beq +
;; We were in a program, so show IN <line>
jsr printf
.byte " IN ",0
lda basic_current_line_number+1
ldx basic_current_line_number+0
jsr print_integer
*
;; New lines
lda #$0d
jsr $ffd2