preparation towardfs string concatenation
This commit is contained in:
1 parent
21a83f92fa
commit
778057e9f2
7 files changed
+59
-12
No files matched your search
@@ -58,10 +58,11 @@ oper_add_strings:
|
|||||||
adc __FAC2+0
|
adc __FAC2+0
|
||||||
bcs_16 do_STRING_TOO_LONG_error
|
bcs_16 do_STRING_TOO_LONG_error
|
||||||
|
|
||||||
// jsr alloc_temp_string
|
|
||||||
|
|
||||||
.break
|
.break
|
||||||
|
|
||||||
|
jsr tmpstr_alloc
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// XXX finish the implementation
|
// XXX finish the implementation
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ do_clr:
|
|||||||
|
|
||||||
// See Computes Mapping the Commodore 64 - page 96
|
// 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
|
jsr JCLALL
|
||||||
|
|
||||||
lda MEMSIZ+0
|
lda MEMSIZ+0
|
||||||
@@ -69,6 +69,13 @@ do_clr:
|
|||||||
sta ARYTAB+1
|
sta ARYTAB+1
|
||||||
sta STREND+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)
|
// FALLTROUGH (confirmed on real C64 that CLR indeed resets DATPTR)
|
||||||
|
|
||||||
do_restore:
|
do_restore:
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
end_of_statement:
|
end_of_statement:
|
||||||
|
|
||||||
|
jsr tmpstr_free_all
|
||||||
jsr fetch_character_skip_spaces
|
jsr fetch_character_skip_spaces
|
||||||
|
|
||||||
cmp #$3A // check for colon
|
cmp #$3A // check for colon
|
||||||
|
|||||||
@@ -27,16 +27,7 @@ execute_statements:
|
|||||||
|
|
||||||
// Not end of the line - it seems we actually have something to execute
|
// 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
|
// Move token code to .X
|
||||||
|
|
||||||
tax
|
tax
|
||||||
|
|
||||||
// Push the 'end_of_statement' address for RTS
|
// Push the 'end_of_statement' address for RTS
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// #LAYOUT# STD * #TAKE
|
||||||
|
// #LAYOUT# * BASIC_0 #TAKE
|
||||||
|
// #LAYOUT# * * #IGNORE
|
||||||
|
|
||||||
|
|
||||||
|
tmpstr_free_all:
|
||||||
|
|
||||||
|
// XXX implement this
|
||||||
|
|
||||||
|
rts
|
||||||
@@ -289,6 +289,22 @@ varstr_garbage_collect_check_bptr:
|
|||||||
lda __FAC1+2
|
lda __FAC1+2
|
||||||
adc INDEX+1
|
adc INDEX+1
|
||||||
sta __FAC1+2
|
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
|
// Next iteration
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user