Array length: Difference between revisions
Content deleted Content added
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 41:
Array length is computed at compilation time with the formula: (Array_End-Array). Even though the labels Array and Array_End are both 16-bit values, if their difference fits into 8 bits the assembler will allow you to load it into a register.
<lang 6502asm>start:
LDA #(Array_End-Array) ;evaluates to
RTS
Array:
byte
byte "orange",0
Array_End:</lang>
|