It's been a while since I've done this so I figured I'd better double check because my memory is crap.
If I go
dim MyArray=a
Then MyArray[0] is a and MyArray[1] is b, correct?
Posted Sat Oct 16, 2010 12:48 AM
Posted Sat Oct 16, 2010 5:31 AM
Posted Sat Oct 16, 2010 1:31 PM
jbs30000, on Sat Oct 16, 2010 12:48 AM, said:
; MyArray[0] LDX 0 LDA MyArray,X ; MyArray[1] LDX 1 LDA MyArray,XMichael
Posted Sat Oct 16, 2010 1:50 PM
Random Terrain, on Sat Oct 16, 2010 5:31 AM, said:
rem dim a Superchip array for writing and reading dim w_MyArray=$F000 dim r_MyArray=$F080 w_MyArray[12]=rand w_MyArray[12]=r_MyArray[12]+1
rem modify the index instead of dimming twice dim MyArray=$F000 rem use index 0 to 127 for writing rem use index 128 to 255 for reading MyArray[12]=rand MyArray[12]=MyArray[140]+1In the second example, note that 140=12+128, so it does the same thing as the first example (add 1 to the element with index 12). However, the second example/method is harder for the reader to understand, and it will work only for Superchip expansion RAM (since the Superchip has 128 bytes of RAM, so there are a total of 256 write and read addresses).
0 members, 0 guests, 0 anonymous users