string assignment can sometimes reuse old string alocated memory

This commit is contained in:
FeralChild64 committed 2020-07-18 13:55:19 +02:00
1 parent 60f30f22fb
commit c50595ab2d
4 files changed
+97 -59

No files matched your search

@@ -0,0 +1,32 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
//
// Helper routine to copy string descriptor, for LET command
//
#if CONFIG_MEMORY_MODEL_38K
helper_let_strdesccpy:
ldy #$02
lda (VARPNT), y
sta DSCPNT+2
dey
lda (VARPNT), y
sta DSCPNT+1
dey
// .Y is now 0 - copy the content
!:
lda (__FAC1+1),y
sta (DSCPNT+1),y
iny
cpy __FAC1+0
bne !-
rts
#endif