Literals/String: Difference between revisions
m
→{{header|68000 Assembly}}
Puppydrum64 (talk | contribs) |
Puppydrum64 (talk | contribs) |
||
Line 72:
{{trans|6502 Assembly}}
Strings are enclosed in double quotes. [[C]] places a null terminator at the end of the string for you; in 68000 Assembly you have to type it manually (unless your assembler has an <code>.ASCIZ</code> directive or equivalent, and not all do).
<lang 68000devpac>DC.B "Hello World",0
EVEN</lang>
Any typed character in double quotes is assembled as the ASCII equivalent of that character. Therefore the following two data blocks are equivalent:
<lang 68000devpac>DC.B "Hello World",0
EVEN
DC.B $48,$65,$6c,$6c,$6f,$20,$57,$6f,$72,$6c,$64,$00
EVEN</lang>
The assembler typically assumes nothing with regard to special characters
=={{header|Ada}}==
|