Slide 5.7: Multiple initializers Slide 5.9: Defining WORD and SWORD data Home |
preface BYTE "Hello", 0
Each character uses a byte of storage. The above code is equal to:
preface BYTE 'H', 'e', 'l', 'l', 'o', 0
A string can be spread across multiple lines, for example:
preface BYTE "Assembly language for Intel computers", 0Dh, 0Ah BYTE "A book for IA-32 processor architecture.", 0The hexadecimal bytes
0Dh
and 0Ah
(carriage-return line-feed) advance the cursor to the beginning of the next line of standard output.
The continuation character (\) may be used to concatenate two lines into a single program statement. For example, the following two statements are the same:
preface BYTE "Assembly language for Intel computers", 0 preface \ BYTE "Assembly language for Intel computers", 0
Replacing a Character | Printing Part of a String | 4 + 6 |
Output | Output | Output |
This is a test. | test. | 10 |