Array length: Difference between revisions
→{{header|68000 Assembly}}
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 53:
Array length is computed at compilation time with the formula: (Array_End-Array). Even though the labels Array and Array_End are both 32-bit memory addresses, if their difference is small enough it can fit into a 16-bit or even an 8-bit instruction operand.
<lang 68000devpac>start:
MOVE.B #(Array_End-Array) ;evaluates to
RTS
Array:
DC.B
even
DC.B "orange",0
even
Array_End:</lang>
|