diff --git a/CREDITS.md b/CREDITS.md index d4bef889..c1cfb957 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -24,6 +24,11 @@ * silverdr - for the floating point routines [description](https://codebase64.org/doku.php?id=base:kernal_floating_point_mathematics) * the [C64 Wiki](https://www.c64-wiki.com) contributors +## other + +* Gábor Lénárt - for his work on [XEMU Mega65 emulator](https://github.com/lgblgblgb/xemu) +* Mads Nielsen - for the [Kick Assembler](http://www.theweb.dk/KickAssembler/Main.html#frontpage) +
* ... and all the others we forgot diff --git a/src/basic/basic_commands/cmd_let.s b/src/basic/basic_commands/cmd_let.s index 395d4b1c..2d36d6e7 100644 --- a/src/basic/basic_commands/cmd_let.s +++ b/src/basic/basic_commands/cmd_let.s @@ -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 diff --git a/src/basic/engine/fetch_variable.s b/src/basic/engine/fetch_variable.s index 0bb308cd..a452ec9e 100644 --- a/src/basic/engine/fetch_variable.s +++ b/src/basic/engine/fetch_variable.s @@ -133,7 +133,7 @@ fetch_variable_find_addr_loop: fetch_variable_adjust_VARPNT: - // Adjust VARPNT to point just after variable name and quit + // Adjust VARPNT to point just after variable name (XXX is it needed?) and quit #if !HAS_OPCODES_65CE02 @@ -170,15 +170,72 @@ fetch_variable_alocate: // First check if we have enough space for a new descriptor +#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 + + // XXX + // XXX: implement this + // XXX + +#endif // If needed, move all the arrays up +#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 + + // XXX + // XXX: implement this + // XXX + +#endif // Set pointer to new variable +#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 + + // XXX + // XXX: implement this + // XXX + +#endif // Fill-in the new variable name, descriptor (it is enough to zero first 2 bytes of content) diff --git a/src/basic/engine/varstr_free.s b/src/basic/engine/varstr_free.s index c61aae3a..222385b7 100644 --- a/src/basic/engine/varstr_free.s +++ b/src/basic/engine/varstr_free.s @@ -11,6 +11,9 @@ // XXX test this routine +// XXX handle strings located in program area +// XXX change DSCPNT format to be compliant with all other descriptors + varstr_free: // First copy the string descriptor data to DSCPNT diff --git a/src/basic/engine/varstr_garbage_collect.s b/src/basic/engine/varstr_garbage_collect.s index 96b4c027..e4ec3e8d 100644 --- a/src/basic/engine/varstr_garbage_collect.s +++ b/src/basic/engine/varstr_garbage_collect.s @@ -4,6 +4,9 @@ // XXX test this routine +// XXX change DSCPNT format to be compliant with all other descriptors + + varstr_garbage_collect: // The routine utilizes the 'shift_mem_up' - which leaves INDEX+0 and INDEX+1