some more work towards arrays

This commit is contained in:
FeralChild64 committed 2020-07-22 20:16:25 +02:00
1 parent 3189edd0d3
commit 800361b27f
6 files changed
+57 -11

No files matched your search

+1 -1
View File
@@ -53,7 +53,7 @@
.label OPMASK = $4D // -- NOT IMPLEMENTED --
.label DEFPNT = $4E // $4E-$4F -- NOT IMPLEMENTED --
.label DSCPNT = $50 // $50-$52 temporary area fro string handling, [!] our usage might differ
.label FOUR6 = $53 // -- NOT IMPLEMENTED --
.label FOUR6 = $53 // size of variable content (float = 5, integer = 2, string descriptor = 3)
.label JMPER = $54 // $54-$56 -- NOT IMPLEMENTED --
.label TEMPF1 = $57 // $57-$5B BASIC numeric work area
.label TEMPF2 = $5C // $5C-$60 BASIC numeric work area
@@ -19,8 +19,6 @@ cmd_inputhash:
nop
cmd_input:
nop
cmd_dim:
nop
cmd_read:
nop
cmd_if:
+6
View File
@@ -0,0 +1,6 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
// PLACEHOLDER for completeness - jumptable contains direct address
+6
View File
@@ -0,0 +1,6 @@
// #LAYOUT# STD * #TAKE
// #LAYOUT# * BASIC_0 #TAKE
// #LAYOUT# * * #IGNORE
// PLACEHOLDER for completeness - jumptable contains direct address
+13
View File
@@ -5,6 +5,19 @@
array_create:
// First retrieve array name
jsr fetch_variable_name
bcs_16 do_SYNTAX_error
// It will be easier if we first perform garbage collecion (arrays are not declared often)
jsr varstr_garbage_collect
// XXX bit DIMFLG, bmi = use default params
// XXX
jsr do_NOT_IMPLEMENTED_error
@@ -4,7 +4,7 @@
//
// Carry set = failure, not recognized variable name
//
// sets FOUR6 and DIMFLG ($80 for array, $00 for regular variable)
fetch_variable_name:
@@ -61,6 +61,9 @@ fetch_variable_check_type:
fetch_variable_type_float:
lda #$05
sta FOUR6
#if !HAS_OPCODES_65CE02
jsr unconsume_character
#else
@@ -71,19 +74,25 @@ fetch_variable_type_float:
fetch_variable_type_integer:
ldy #$02
lda #$02
sta FOUR6
lda VARNAM+0
ora #$80
sta VARNAM+0
lda #$00
skip_2_bytes_trash_nvz
// FALLTROUGH
beq !+ // branch always
fetch_variable_type_string:
ldy #$03
lda #$80
!:
sta VALTYP
sty FOUR6
lda VARNAM+1
ora #$80
@@ -93,10 +102,24 @@ fetch_variable_type_string:
fetch_variable_name_check_array:
// XXX add check for array
jsr fetch_character_skip_spaces
cmp #$28 // '('
beq !+
// This is not an array
#if !HAS_OPCODES_65CE02
jsr unconsume_character
#else
dew TXTPTR
#endif
lda #$00
skip_2_bytes_trash_nvz
!:
// This is an array
lda #$80
sta DIMFLG
clc
rts