diff --git a/src/basic/engine_variables/array_create.s b/src/basic/engine_variables/array_create.s index 867d1e89..a8de236a 100644 --- a/src/basic/engine_variables/array_create.s +++ b/src/basic/engine_variables/array_create.s @@ -10,15 +10,18 @@ array_create: jsr fetch_variable_name bcs_16 do_SYNTAX_error - // XXX check if the array already exists + // Make sure the array does not exist + + jsr find_array + bcc_16 do_REDIMD_ARRAY_error // Push variable name and FOUR6 on the stack - fetching dimensions might cause // the to be overwritten by the expression parser - lda VARNAM+0 - pha lda VARNAM+1 pha + lda VARNAM+0 + pha lda FOUR6 pha @@ -180,7 +183,7 @@ array_create_store_dims_done: // Restore FOUR6, calculate number of bytes needed for storage pla - sta FOUR6 // XXX do we need to store this value in FOUR6? is it still needed? + sta FOUR6 // needed by variable fetch routine sta __FAC1+3 stx __FAC1+4 // .X is 0 at this point diff --git a/src/basic/engine_variables/fetch_variable.s b/src/basic/engine_variables/fetch_variable.s index 29957635..7333ab14 100644 --- a/src/basic/engine_variables/fetch_variable.s +++ b/src/basic/engine_variables/fetch_variable.s @@ -57,36 +57,8 @@ fetch_variable_find_addr_loop: beq fetch_variable_alocate !: // Compare current variable name with searched one - // XXX consider creating optimized version for 46K/50K memory models -#if CONFIG_MEMORY_MODEL_46K || CONFIG_MEMORY_MODEL_50K jsr helper_cmp_varnam -#else - - ldy #$00 - -#if CONFIG_MEMORY_MODEL_60K - ldx #