some more work on string assignment

This commit is contained in:
FeralChild64 committed 2020-07-14 22:19:33 +02:00
1 parent ac7fff95e5
commit e349aa64f9
5 files changed
+140 -1

No files matched your search

+71
View File
@@ -117,6 +117,77 @@ cmd_let_assign_string:
lda VALTYP
bpl_16 do_TYPE_MISMATCH_error
// Copy the string descriptor to DSCPNT
#if CONFIG_MEMORY_MODEL_60K
// XXX
// XXX: implement this
// XXX
#elif CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K
// XXX consider optimized version without multiple JSRs
// XXX
// XXX: implement this
// XXX
#else // CONFIG_MEMORY_MODEL_38K
ldy #$00
lda (VARPNT), y
sta DSCPNT+0
iny
lda (VARPNT), y
sta DSCPNT+1
iny
lda (VARPNT), y
sta DSCPNT+2
#endif
// First special case - check if the new string has size 0
// XXX
// Check if the source and destination strings are the same (VARPNT should now point just after variable name)
lda VARPNT+1
cmp __FAC1+1
bne !+
iny
lda VARPNT+2
cmp __FAC1+2
bne !+
// If we are here, than both source and destination strings are the same - nothing more to be done
rts
!:
// Strings are not the same - check if the new one is located within a text area, between TXTTAB and VARTAB
// XXX
// Check if size of both equals and the old on is above FRETOP
// XXX
// Check if new one is at least 3 bytes shorter and the old one is above FRETOP
// XXX
// Free the memory of the old string, it is not possible to reuse it
// XXX
// Check if the new string is a temporary one - if so, reuse already done alocation
// XXX
// No special case optimization is possible - alocate new memory area and copy the string
// XXX
#if CONFIG_MEMORY_MODEL_60K
// XXX