abort line search as soon as we find a line with too high a line number.
This commit is contained in:
1 parent
5358743318
commit
b7de93a3a6
1 file changed
+8
-5
@@ -11,14 +11,16 @@ basic_find_line:
|
|||||||
basic_find_line_loop:
|
basic_find_line_loop:
|
||||||
;; Then search for line number
|
;; Then search for line number
|
||||||
;; Line number
|
;; Line number
|
||||||
ldy #2
|
ldy #3
|
||||||
ldx #<basic_current_line_ptr
|
ldx #<basic_current_line_ptr
|
||||||
jsr peek_under_roms
|
jsr peek_under_roms
|
||||||
cmp basic_line_number+0
|
|
||||||
bne not_this_line
|
|
||||||
iny
|
|
||||||
jsr peek_under_roms
|
|
||||||
cmp basic_line_number+1
|
cmp basic_line_number+1
|
||||||
|
bcs line_num_too_high
|
||||||
|
bne not_this_line
|
||||||
|
dey
|
||||||
|
jsr peek_under_roms
|
||||||
|
cmp basic_line_number+0
|
||||||
|
bcs line_num_too_high
|
||||||
bne not_this_line
|
bne not_this_line
|
||||||
|
|
||||||
clc
|
clc
|
||||||
@@ -33,6 +35,7 @@ not_this_line:
|
|||||||
jsr peek_under_roms
|
jsr peek_under_roms
|
||||||
bne more_lines_exist
|
bne more_lines_exist
|
||||||
;; no more lines exist, return failure
|
;; no more lines exist, return failure
|
||||||
|
line_num_too_high:
|
||||||
sec
|
sec
|
||||||
rts
|
rts
|
||||||
more_lines_exist:
|
more_lines_exist:
|
||||||
|
|||||||
Reference in new issue
Block a user