Quoting constructs: Difference between revisions

m (→‎{{header|6502 Assembly}}: additional details and clarification)
Line 647:
Single (") or dual ("") double-quotes can be included without problem.
</pre>
 
=={{header|Z80 Assembly}}==
{{trans|6502 Assembly}}
Quoting constructs is very straightforward. The use of quotation marks tells the assembler that the data inside those quotation marks is to be assembled as ASCII values. A null terminator must go outside the quotation marks. There is no built-in support for control codes, as the assembler does not assume that any "putS" routine exists. Whatever functions you create that use these strings will have to be given the capability of handling control codes.
 
Unlike some languages, there is no limit on how long a string can be. A text string can span as many lines as you want it to, since
the null terminator is the only way the CPU knows it will end (assuming that your "putS" routine uses a null terminator.)
 
<lang z80>MyString:
byte "Hello World",0 ;a null-terminated string
LookupTable:
byte &03,&06,&09,&0C ;a pre-defined sequence of bytes (similar in concept to enum in C)
TileGfx:
incbin "Z:\game\gfx\tilemap.bmp" ;a file containing bitmap graphics data</lang>
 
=={{header|zkl}}==
1,489

edits