as: Strings
1
1 3.6.1.1 Strings
1 ...............
1
1 A "string" is written between double-quotes. It may contain
1 double-quotes or null characters. The way to get special characters
1 into a string is to "escape" these characters: precede them with a
1 backslash '\' character. For example '\\' represents one backslash: the
1 first '\' is an escape which tells 'as' to interpret the second
1 character literally as a backslash (which prevents 'as' from recognizing
1 the second '\' as an escape character). The complete list of escapes
1 follows.
1
1 '\b'
1 Mnemonic for backspace; for ASCII this is octal code 010.
1
1 'backslash-f'
1 Mnemonic for FormFeed; for ASCII this is octal code 014.
1
1 '\n'
1 Mnemonic for newline; for ASCII this is octal code 012.
1
1 '\r'
1 Mnemonic for carriage-Return; for ASCII this is octal code 015.
1
1 '\t'
1 Mnemonic for horizontal Tab; for ASCII this is octal code 011.
1
1 '\ DIGIT DIGIT DIGIT'
1 An octal character code. The numeric code is 3 octal digits. For
1 compatibility with other Unix systems, 8 and 9 are accepted as
1 digits: for example, '\008' has the value 010, and '\009' the value
1 011.
1
1 '\x HEX-DIGITS...'
1 A hex character code. All trailing hex digits are combined.
1 Either upper or lower case 'x' works.
1
1 '\\'
1 Represents one '\' character.
1
1 '\"'
1 Represents one '"' character. Needed in strings to represent this
1 character, because an unescaped '"' would end the string.
1
1 '\ ANYTHING-ELSE'
1 Any other character when escaped by '\' gives a warning, but
1 assembles as if the '\' was not present. The idea is that if you
1 used an escape sequence you clearly didn't want the literal
1 interpretation of the following character. However 'as' has no
1 other interpretation, so 'as' knows it is giving you the wrong code
1 and warns you of the fact.
1
1 Which characters are escapable, and what those escapes represent,
1 varies widely among assemblers. The current set is what we think the
1 BSD 4.2 assembler recognizes, and is a subset of what most C compilers
1 recognize. If you are in doubt, do not use an escape sequence.
1