I figured it out! Woohoo!
Code:
ld b, 4
; input b the size of the list minus one
_LOneToArray:
push bc
ld hl, L1Name
rst rMov9ToOP1
b_call(_FindSym)
pop bc
ld a, b
inc a
push bc
ld l, a
ld h, 0
b_call(_GetLToOP1)
b_call(_ConvOP1) ; the desired element is now in DE
pop bc
push bc
ld ix, Arr
call SetArray16
pop bc
djnz _LOneToArray
; final loop, for when b == 0. small brain but it works
ld b, 0
push bc
ld hl, L1Name
rst rMov9ToOP1
b_call(_FindSym)
pop bc
ld a, b
inc a
push bc
ld l, a ; which element we want
ld h, 0
b_call(_GetLToOP1)
b_call(_ConvOP1) ; the desired element is now in DE
pop bc
push bc
ld ix, Arr
call SetArray16
pop bc
ret
Arr:
.dw 0, 0, 0, 0, 0
L1Name:
.db ListObj, tVarLst, tL1, 0, 0
; retrieve and print element of arr
; input ix array to get element from
; input b index of element
; output hl is arr[index]
; destroys c
GetArray16:
ld c, b
ld b, 0
ld h, b ; double index
ld l, c
add hl, bc
ld b, h
ld c, l
add ix, bc ; offset array by index
ld a, (ix + 0) ; access array at index and store in hl
ld l, a
ld a, (ix + 1)
ld h, a
ret
; change and then retrieve and print element of arr
; input ix is array
; input b is index to set
; input de is array[index] = de
; destroys c
SetArray16:
ld c, b
ld b, 0
ld h, b
ld l, c
add hl, bc
ld b, h
ld c, l
add ix, bc
ld a, e
ld (ix + 0), a
ld a, d
ld (ix + 1), a
ret