Jump to content

Literals/String: Difference between revisions

no edit summary
No edit summary
Line 34:
If raw string literal should contains unpaired single quotation marks, then balancing of raw string should be performed:
<lang 11l>'‘‘don’t’ // the same as "don’t"</lang>
=={{header|6502 Assembly}}==
Strings are enclosed in double quotes.
<lang 6502asm>db "Hello World"</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 6502asm>db "Hello World"
db $48,$65,$6c,$6c,$6f,$20,$57,$6f,$72,$6c,$64</lang>
 
The assembler typically assumes nothing with regard to special characters. How special characters are handled depends on the printing routine of the hardware's BIOS, or one created by the programmer. If your printing routine is able to support a null terminator and ASCII control codes, the following represents "Hello World" with the new line command and null terminator:
<lang 6502asm>db "Hello World",13,10,0</lang>
=={{header|Ada}}==
 
1,489

edits

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