begin implementing LIST command
This commit is contained in:
1 parent
6a0b2d8e7f
commit
c7db426bd3
3 files changed
+53
-1
No files matched your search
@@ -0,0 +1,15 @@
|
|||||||
|
;; Advance basic_current_line_ptr by following the
|
||||||
|
;; link to the next line
|
||||||
|
|
||||||
|
basic_find_next_line:
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
ldx #<basic_current_line_ptr
|
||||||
|
jsr peek_under_roms
|
||||||
|
pha
|
||||||
|
iny
|
||||||
|
jsr peek_under_roms
|
||||||
|
sta basic_current_line_ptr+1
|
||||||
|
pla
|
||||||
|
sta basic_current_line_ptr+0
|
||||||
|
rts
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
;; LIST basic text.
|
||||||
|
;; XXX - Doesn't currently support line number ranges
|
||||||
|
|
||||||
|
cmd_list:
|
||||||
|
|
||||||
|
;; Set current line pointer to start of memory
|
||||||
|
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
|
||||||
|
|
||||||
|
list_loop:
|
||||||
|
ldx #<basic_current_line_ptr
|
||||||
|
ldy #0
|
||||||
|
jsr peek_pointer_null_check
|
||||||
|
bcs list_more_lines
|
||||||
|
|
||||||
|
jmp basic_main_loop
|
||||||
|
|
||||||
|
list_more_lines:
|
||||||
|
;; Print line number
|
||||||
|
ldy #3
|
||||||
|
jsr peek_under_roms
|
||||||
|
pha
|
||||||
|
dey
|
||||||
|
jsr peek_under_roms
|
||||||
|
tax
|
||||||
|
pla
|
||||||
|
jsr print_integer
|
||||||
|
|
||||||
|
;; Print end of line
|
||||||
|
lda #$0d
|
||||||
|
jsr $ffd2
|
||||||
|
|
||||||
|
;; Now link to the next line
|
||||||
|
jsr basic_find_next_line
|
||||||
|
jmp list_loop
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ cmd_poke:
|
|||||||
cmd_printhash:
|
cmd_printhash:
|
||||||
cmd_print:
|
cmd_print:
|
||||||
cmd_cont:
|
cmd_cont:
|
||||||
cmd_list:
|
|
||||||
cmd_cmd:
|
cmd_cmd:
|
||||||
cmd_sys:
|
cmd_sys:
|
||||||
cmd_open:
|
cmd_open:
|
||||||
|
|||||||
Reference in new issue
Block a user