Jump to content

Long literals, with continuations: Difference between revisions

m
clarification
m (→‎{{header|6502 Assembly}}: removed trailing spaces)
m (clarification)
Line 83:
Hello WorldGoodbye World!
</pre>
 
In addition, it makes no difference to the assembler whether each string is on its own line, or each is one after the other on the same line. It's easier to put each on its own line since you can't have a label mid-line.
 
Since each string is of variable length, it is much easier to make a lookup table of the elements ordered by atomic number, with each element in the lookup table being a pointer to the actual string consisting of that element's name.
 
<lang 6502asm>Elements:
; this is typed in a compact manner to save on typing, however putting each on its own line with a
; "dw" directive in front will produce the same result. A comment with the element number on each line will aid in
; adding new elements to the list.
dw nullString,hydrogen,helium,lithium,beryllium,boron,carbon,nitrogen,oxygen,fluorine
dw neon,sodium,magnesium,aluminum,silicon,phosphorous,sulfur,chlorine,argon
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.