preparation towardfs string concatenation

This commit is contained in:
FeralChild64 committed 2020-07-18 17:28:56 +02:00
1 parent 21a83f92fa
commit 778057e9f2
7 files changed
+59 -12

No files matched your search

+3 -2
View File
@@ -58,10 +58,11 @@ oper_add_strings:
adc __FAC2+0
bcs_16 do_STRING_TOO_LONG_error
// jsr alloc_temp_string
.break
jsr tmpstr_alloc
// XXX finish the implementation
+8 -1
View File
@@ -51,7 +51,7 @@ do_clr:
// See Computes Mapping the Commodore 64 - page 96
// XXX check on real ROMs that it is being done too when entering new line
// XXX check if original ROM does this too
jsr JCLALL
lda MEMSIZ+0
@@ -69,6 +69,13 @@ do_clr:
sta ARYTAB+1
sta STREND+1
// This is a good place to reset the temporary string stack
lda #$19
sta TEMPPT
lda #$16
sta LASTPT
// FALLTROUGH (confirmed on real C64 that CLR indeed resets DATPTR)
do_restore:
+1
View File
@@ -9,6 +9,7 @@
end_of_statement:
jsr tmpstr_free_all
jsr fetch_character_skip_spaces
cmp #$3A // check for colon
@@ -27,16 +27,7 @@ execute_statements:
// Not end of the line - it seems we actually have something to execute
// Initialize temporary string stack - just about any statement might need it
// XXX original C64 ROM initializes this during the startup too - not sure where to put this
ldx #$16
stx LASTPT
ldx #$19
stx TEMPPT
// Move token code to .X
tax
// Push the 'end_of_statement' address for RTS
+21
View File
@@ -0,0 +1,21 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Allocates memory for a temporary string
//
// Input:
// -.A desired string length, has to be > 0
//
//
tmpstr_alloc:
// First we need to find a free temporary string descriptor
// XXX TEMPPT-> LASTPT
// XXX implement this
rts
+10
View File
@@ -0,0 +1,10 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
tmpstr_free_all:
// XXX implement this
rts
+16
View File
@@ -289,6 +289,22 @@ varstr_garbage_collect_check_bptr:
lda __FAC1+2
adc INDEX+1
sta __FAC1+2
!:
// Same for __FAC2
lda __FAC2+2
cmp TXTPTR+1
bne !+
lda __FAC2+1
cmp TXTPTR+0
bne !+
clc
adc INDEX+0
sta __FAC2+1
lda __FAC2+2
adc INDEX+1
sta __FAC2+2
!:
// Next iteration