more work towards string concatenation, updated binaries and documentation

This commit is contained in:
FeralChild64 committed 2020-07-18 20:04:36 +02:00
1 parent 778057e9f2
commit 59af3b7e57
12 files changed
+103 -18

No files matched your search

+64 -4
View File
@@ -52,21 +52,81 @@ oper_add_strings:
jmp FRMEVL_continue
!:
// Allocate memory for concatenated string
// Allocate memory for the concatenated string
clc
adc __FAC2+0
bcs_16 do_STRING_TOO_LONG_error
.break
jsr tmpstr_alloc
// Copy the temporary string pointer to INDEX
ldy #$01
lda (VARPNT), y
sta INDEX+0
iny
lda (VARPNT), y
sta INDEX+1
// Perform the concatenation
// XXX finish the implementation
#if CONFIG_MEMORY_MODEL_60K
// XXX
// XXX
// XXX
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
// XXX consider optimized version without multiple JSRs
// XXX
// XXX
// XXX
#else // CONFIG_MEMORY_MODEL_38K
// Copy data from the first string
ldy #$00
!:
lda (__FAC2+1),y
sta (INDEX),y
iny
cpy __FAC2+0
bne !-
// Increase INDEX pointer by the size of the 1st string
tya
jsr varstr_INDEX_up_A
// Copy data from the second string
ldy #$00
!:
lda (__FAC1+1),y
sta (INDEX),y
iny
cpy __FAC1+0
bne !-
#endif
// Free old strings - if they are temporary
// XXX
// XXX
// XXX
// Copy the descriptor to __FAC1
ldy #$02
!:
lda (VARPNT), y
sta __FAC1, y
dey
bpl !-
oper_add_strings_end:
+27 -3
View File
@@ -8,14 +8,38 @@
// Input:
// -.A desired string length, has to be > 0
//
// Output:
// - VARPNT points to the newly alocated descriptor
//
tmpstr_alloc:
tax
// First we need to find a free temporary string descriptor
// XXX TEMPPT-> LASTPT
lda TEMPPT
cmp #$22
bcs_16 do_FORMULA_TOO_COMPLEX_error
// XXX implement this
tay
sta LASTPT
clc
adc #$03
sta TEMPPT
rts
// Store desired string length
stx $00, y
// Store descriptor address
lda LASTPT
sta VARPNT+0
lda #$00
sta VARPNT+1
// Jump to alocation routine
// XXX consider falltrough
jmp varstr_alloc
-1
View File
@@ -20,7 +20,6 @@
// - fills-in pointer in the string descriptor
//
// XXX test this routine
varstr_alloc: