Mac,
Again, thanks so much!! You're my fav on the forums, soooo very knowledgeable!! That was exactly what I needed to see! BUT... haha, always a BUT... I have seen this in my 'old' code I'm working with:
LDA ARRAYNAME-1, X
So is that loading the accumlator withe the (X - 1) element of the array?
I need to create a new array from scratch, but I have to figure out what the original is doing
And let me make sure I'm doing this correct (and hopefully efficient)...
Store the numbers 25,15,7,2,1 to 5 elements of an array...
DATAARRAY:MEMBERS DS 1CARS DS 1TRUCKS DS 1BOATS DS 1BIKES DS 1
CLRXLDA #25 ; 25 MembersSTA DATAARRAY, XINCXLDA #15 ; 15 CarsSTA DATAARRAY, XINCXLDA #7 ; 7 TrucksSTA DATAARRAY, XINCXLDA #2 ; 2 BoatsSTA DATAARRAY, XINCXLDA #1 ; 1 BikeSTA DATAARRAY, X
And then I could also updat Trucks later on like this:
LDA #8STA TRUCKS
And lets say I wanted to update Boats AND Bikes, how do I say "array element + 1"...
LDX #3 ; 'Boats' is element 3LDA #5 ; new number of BoatsSTA DATAARRAY, XLDA #3 ; new number of BikesSTA DATAARRY + 1, X
I know I could INCX before updating Bikes, but maybe its 13 elements away...
Anyway, THANK YOU SO MUCH for all the info and help.
-Mike