Arrays: Difference between revisions

m
m (→‎{{header|68000 Assembly}}: added constant array declaration)
Line 120:
LDA $0480,x ;evaluates to LDA $0500</lang>
 
If you really want to read from an array in the zero page like this (and chances are you won't since that array also starts to overlap with the hardware stack), you can use an absolute addressing mode in the zero page. Beware - some assemblers will forcibly optimize <code>LDA $00??</code> into <code>LDA $??</code> so you may have to inline the bytecode for it directly. If you stick to arrays outsize the zero page you don't need to worry about index wraparound.
 
===Arrays of 16-Bit Data===
You can have arrays of 16-bit data as well as 8-bit ones. There are a few ways to do this, and we'll go over the "naive" way first:
1,489

edits