diff --git a/c64/basic/basic_shift_mem_down.s b/c64/basic/basic_shift_mem_down.s index 87f1f742..5b0bba9b 100644 --- a/c64/basic/basic_shift_mem_down.s +++ b/c64/basic/basic_shift_mem_down.s @@ -75,8 +75,8 @@ basic_shift_mem_down_and_relink: sbc #0 sta memmove_dst+1 - ;; Get Y value ready for the copy - ldy memmove_size+0 + ;; Increase copy page count so we can post-decrement compare with $00 + inc memmove_size+1 jsr printf .byte "REVISED BOUNDS $" @@ -90,17 +90,18 @@ basic_shift_mem_down_and_relink: .byte $f0,memmove_dst .byte $0d,0 + ;; Get Y value ready for the copy + ldy memmove_size+0 + jsr shift_mem_down - inc $d020 - ;; Get length of deletion back pla sta tokenise_work3 relink_down_next_line: - inc $d020 - jmp relink_down_next_line + ;; inc $d020 + ;; jmp relink_down_next_line ;; Subtract tokenise_work3 from the pointer ldy #0 @@ -134,5 +135,6 @@ relink_down_loop: jsr peek_pointer_null_check bcs relink_down_next_line + clc rts diff --git a/c64/basic/under_rom_routines.s b/c64/basic/under_rom_routines.s index fcf7103c..26ad0cee 100644 --- a/c64/basic/under_rom_routines.s +++ b/c64/basic/under_rom_routines.s @@ -55,7 +55,7 @@ shift_mem_down_routine: ;; to the end of the areas, and that Y is correctly initialised ;; to allow the copy to begin. jsr memmap_allram -smd1: +smd1: lda (memmove_src),y sta (memmove_dst),y iny