Variable size/Set: Difference between revisions

m
→‎{{header|68000 Assembly}}: fixed broken code closer
m (→‎{{header|6502 Assembly}}: fixed broken code closer)
m (→‎{{header|68000 Assembly}}: fixed broken code closer)
Line 88:
DC.L 0 ;this takes up 4 bytes even though only one 0 was written</lang>
 
For programs that are executed solely from ROM, such as video game console cartridges, you won't be able to use the above method. The assembler can often use an <code>enum</code> or <code>rsset</code> directive to sequentially assign labels to a series of consecutive memory locations in the system's RAM. Assemblers that don't have an <code>enum</code> or <code>rsset</code> directive can use the <code>equ</code> directive instead. This method lets you immediately see what each memory location actually is, but it makes it harder to insert a new one without having to redo all the numbering. These variables are located in the heap and thus there is no need to use <code>EVEN</code> directives to align this data.
 
<lang 68000devpac>
1,489

edits