📄 strings.html
字号:
<html lang="en">
<head>
<title>Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.3">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
</head>
<body>
<div class="node">
<p>
Node:<a name="Strings">Strings</a>,
Next:<a rel="next" accesskey="n" href="Chars.html#Chars">Chars</a>,
Up:<a rel="up" accesskey="u" href="Characters.html#Characters">Characters</a>
<hr><br>
</div>
<h5 class="subsubsection">Strings</h5>
<p>A <dfn>string</dfn> is written between double-quotes. It may contain
double-quotes or null characters. The way to get special characters
into a string is to <dfn>escape</dfn> these characters: precede them with
a backslash <code>\</code> character. For example <code>\\</code> represents
one backslash: the first <code>\</code> is an escape which tells
<code>as</code> to interpret the second character literally as a backslash
(which prevents <code>as</code> from recognizing the second <code>\</code> as an
escape character). The complete list of escapes follows.
<dl>
<dt><kbd>\b</kbd>
<dd>Mnemonic for backspace; for ASCII this is octal code 010.
<br><dt><kbd>\f</kbd>
<dd>Mnemonic for FormFeed; for ASCII this is octal code 014.
<br><dt><kbd>\n</kbd>
<dd>Mnemonic for newline; for ASCII this is octal code 012.
<br><dt><kbd>\r</kbd>
<dd>Mnemonic for carriage-Return; for ASCII this is octal code 015.
<br><dt><kbd>\t</kbd>
<dd>Mnemonic for horizontal Tab; for ASCII this is octal code 011.
<br><dt><kbd>\ </kbd><var>digit</var><kbd> </kbd><var>digit</var><kbd> </kbd><var>digit</var><kbd></kbd>
<dd>An octal character code. The numeric code is 3 octal digits.
For compatibility with other Unix systems, 8 and 9 are accepted as digits:
for example, <code>\008</code> has the value 010, and <code>\009</code> the value 011.
<br><dt><kbd>\</kbd><code>x</code><kbd> </kbd><var>hex-digits...</var><kbd></kbd>
<dd>A hex character code. All trailing hex digits are combined. Either upper or
lower case <code>x</code> works.
<br><dt><kbd>\\</kbd>
<dd>Represents one <code>\</code> character.
<br><dt><kbd>\"</kbd>
<dd>Represents one <code>"</code> character. Needed in strings to represent
this character, because an unescaped <code>"</code> would end the string.
<br><dt><kbd>\ </kbd><var>anything-else</var><kbd></kbd>
<dd>Any other character when escaped by <kbd>\</kbd> gives a warning, but
assembles as if the <code>\</code> was not present. The idea is that if
you used an escape sequence you clearly didn't want the literal
interpretation of the following character. However <code>as</code> has no
other interpretation, so <code>as</code> knows it is giving you the wrong
code and warns you of the fact.
</dl>
<p>Which characters are escapable, and what those escapes represent,
varies widely among assemblers. The current set is what we think
the BSD 4.2 assembler recognizes, and is a subset of what most C
compilers recognize. If you are in doubt, do not use an escape
sequence.
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -