adapted to Kick Assembler, some documentation update
This commit is contained in:
1 parent
ae23dbae7b
commit
de27124b4f
198 files changed
+4181
-3976
No files matched your search
@@ -1,25 +1,26 @@
|
||||
;; Insert the tokenised line stored at $0200.
|
||||
;; First work out where in the list to put it
|
||||
;; (basic_find_line with the line number can be used to work
|
||||
;; out the insertion point, as it should abort once it finds a
|
||||
;; line number too high).
|
||||
;; Then all we have to do is push the rest of the BASIC text up,
|
||||
;; and update the pointers in all following basic lines.
|
||||
// Insert the tokenised line stored at $0200.
|
||||
// First work out where in the list to put it
|
||||
// (basic_find_line with the line number can be used to work
|
||||
// out the insertion point, as it should abort once it finds a
|
||||
// line number too high).
|
||||
// Then all we have to do is push the rest of the BASIC text up,
|
||||
// and update the pointers in all following basic lines.
|
||||
|
||||
basic_insert_line:
|
||||
|
||||
;; ASSUMES basic_find_line has been called to set the insert point.
|
||||
;; We need to insert space for the link link token, the line number,
|
||||
;; and the zero-terminated line itself. This means 2+2+1 plus length
|
||||
;; of tokenised string after the line number
|
||||
// ASSUMES basic_find_line has been called to set the insert point.
|
||||
// We need to insert space for the link link token, the line number,
|
||||
// and the zero-terminated line itself. This means 2+2+1 plus length
|
||||
// of tokenised string after the line number
|
||||
|
||||
;; But first, remember where the pointer will be, so that we can
|
||||
;; put the line in there after.
|
||||
// But first, remember where the pointer will be, so that we can
|
||||
// put the line in there after.
|
||||
|
||||
;; jsr printf
|
||||
;; .byte "INSERTING LINE AT $"
|
||||
;; .byte $f1,<basic_current_line_ptr,>basic_current_line_ptr
|
||||
;; .byte $f0,<basic_current_line_ptr,>basic_current_line_ptr
|
||||
;; .byte $0d,0
|
||||
// jsr printf
|
||||
// .text "INSERTING LINE AT $"
|
||||
// .byte $f1,<basic_current_line_ptr,>basic_current_line_ptr
|
||||
// .byte $f0,<basic_current_line_ptr,>basic_current_line_ptr
|
||||
// .byte $0d,0
|
||||
|
||||
lda basic_current_line_ptr+0
|
||||
pha
|
||||
@@ -27,20 +28,20 @@ basic_insert_line:
|
||||
|
||||
pha
|
||||
|
||||
;; Get number of bytes in tokenised line after line number
|
||||
// Get number of bytes in tokenised line after line number
|
||||
lda tokenise_work2
|
||||
sec
|
||||
sbc tokenise_work1
|
||||
;; Add on the four bytes space we need
|
||||
// Add on the four bytes space we need
|
||||
clc
|
||||
adc #5
|
||||
pha
|
||||
tax
|
||||
|
||||
;; Make the space
|
||||
// Make the space
|
||||
jsr basic_shift_mem_up_and_relink
|
||||
|
||||
;; Now increase top of BASIC mem
|
||||
// Now increase top of BASIC mem
|
||||
pla
|
||||
clc
|
||||
adc basic_end_of_text_ptr+0
|
||||
@@ -49,13 +50,13 @@ basic_insert_line:
|
||||
adc #0
|
||||
sta basic_end_of_text_ptr+1
|
||||
|
||||
;; Get pointer back
|
||||
// Get pointer back
|
||||
pla
|
||||
sta basic_current_line_ptr+1
|
||||
pla
|
||||
sta basic_current_line_ptr+0
|
||||
|
||||
;; Write the line number
|
||||
// Write the line number
|
||||
ldy #2
|
||||
ldx #<basic_current_line_ptr
|
||||
lda basic_line_number+0
|
||||
@@ -64,7 +65,7 @@ basic_insert_line:
|
||||
lda basic_line_number+1
|
||||
jsr poke_under_roms
|
||||
|
||||
;; Now store the line body itself
|
||||
// Now store the line body itself
|
||||
inc tokenise_work2
|
||||
line_store_loop:
|
||||
ldx tokenise_work1
|
||||
|
||||
Reference in new issue
Block a user