Trying to get some better understanding of working with integer arrays and came across this issue.
Q: When simply printing elements of my array and I don't use ASLX I get unexpected results, but when I use ASLX I get expected results. How does ASLX effect my result?
FOOD:.word 0
.word 1
.word 1
.word 0
main:LDX 3,i ; i = 3
STX i,d
for: CPX 0,i ; i >= 0
BRLT endFor
DECO i,d
CHARO ' ',i
ASLX ; If I remove this I get 256 instead of expected value
DECO FOOD,x ; FOOD[i]
CHARO '\n',i
LDX i,d
SUBX 1,i
STX i,d
BR for
endFor: stop
.end
Thanks