more work towards array support
This commit is contained in:
1 parent
73553362b6
commit
64e1898539
1 file changed
+25
-4
@@ -17,9 +17,9 @@ assign_variable:
|
|||||||
|
|
||||||
// This is an array - push return address to the stack, will be needed later
|
// This is an array - push return address to the stack, will be needed later
|
||||||
|
|
||||||
lda #>(assign_variable_common_2-1)
|
lda #>(assign_variable_arr_ret-1)
|
||||||
pha
|
pha
|
||||||
lda #<(assign_variable_common_2-1)
|
lda #<(assign_variable_arr_ret-1)
|
||||||
pha
|
pha
|
||||||
|
|
||||||
// Store FOUR6 on tha stack
|
// Store FOUR6 on tha stack
|
||||||
@@ -103,6 +103,15 @@ assign_variable_common_1:
|
|||||||
|
|
||||||
bpl assign_variable_not_array_2
|
bpl assign_variable_not_array_2
|
||||||
|
|
||||||
|
// Preserve FAC1 values which might get overwritten
|
||||||
|
|
||||||
|
ldx #$04
|
||||||
|
!:
|
||||||
|
lda __FAC1,x
|
||||||
|
sta __FAC2,x
|
||||||
|
dex
|
||||||
|
bpl !-
|
||||||
|
|
||||||
// Yes, this is an array - fetch the number of dimensions
|
// Yes, this is an array - fetch the number of dimensions
|
||||||
|
|
||||||
pla
|
pla
|
||||||
@@ -111,7 +120,19 @@ assign_variable_common_1:
|
|||||||
|
|
||||||
// Fetch the address of the variable
|
// Fetch the address of the variable
|
||||||
|
|
||||||
jmp fetch_variable_arr_calc_pos // RTS goes to assign_variable_common_2
|
jmp fetch_variable_arr_calc_pos // RTS goes to assign_variable_arr_ret
|
||||||
|
|
||||||
|
assign_variable_arr_ret:
|
||||||
|
|
||||||
|
// Restore FAC1 values
|
||||||
|
|
||||||
|
ldx #$04
|
||||||
|
!:
|
||||||
|
lda __FAC2,x
|
||||||
|
sta __FAC1,x
|
||||||
|
dex
|
||||||
|
bpl !-
|
||||||
|
bmi assign_variable_common_2 // branch always
|
||||||
|
|
||||||
assign_variable_not_array_2:
|
assign_variable_not_array_2:
|
||||||
|
|
||||||
@@ -201,7 +222,7 @@ assign_float:
|
|||||||
jmp do_NOT_IMPLEMENTED_error
|
jmp do_NOT_IMPLEMENTED_error
|
||||||
|
|
||||||
assign_string:
|
assign_string:
|
||||||
.break
|
|
||||||
// Check if value type matches
|
// Check if value type matches
|
||||||
|
|
||||||
lda VALTYP
|
lda VALTYP
|
||||||
|
|||||||
Reference in new issue
Block a user