diff --git a/src/basic/engine/varstr_free.s b/src/basic/engine/varstr_free.s index e9a30778..6eef2046 100644 --- a/src/basic/engine/varstr_free.s +++ b/src/basic/engine/varstr_free.s @@ -59,18 +59,9 @@ varstr_free_inside: // This is not the lowest string; mark it as free // First preserve the string size, it will make it easier for the garbage collector - lda DSCPNT+0 - tay - dey + // Increase DSCPNT+1/+2 to point to the back-pointer minus 1 -#if CONFIG_MEMORY_MODEL_60K - ldx # $01 + // Now fill-in the back-pointer with 0's + + tya + iny + +#if CONFIG_MEMORY_MODEL_60K + jsr poke_under_roms +#else // CONFIG_MEMORY_MODEL_38K || CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K + sta (DSCPNT+1), y +#endif + + iny #if CONFIG_MEMORY_MODEL_60K jmp poke_under_roms