summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/using-assembly-language-with-c.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/gcc~13/using-assembly-language-with-c.html')
-rw-r--r--devdocs/gcc~13/using-assembly-language-with-c.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/devdocs/gcc~13/using-assembly-language-with-c.html b/devdocs/gcc~13/using-assembly-language-with-c.html
new file mode 100644
index 00000000..6152e72b
--- /dev/null
+++ b/devdocs/gcc~13/using-assembly-language-with-c.html
@@ -0,0 +1,6 @@
+<div class="section-level-extent" id="Using-Assembly-Language-with-C"> <div class="nav-panel"> <p> Next: <a href="alternate-keywords" accesskey="n" rel="next">Alternate Keywords</a>, Previous: <a href="volatiles" accesskey="p" rel="prev">When is a Volatile Object Accessed?</a>, Up: <a href="c-extensions" accesskey="u" rel="up">Extensions to the C Language Family</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="section" id="How-to-Use-Inline-Assembly-Language-in-C-Code"><span>6.47 How to Use Inline Assembly Language in C Code<a class="copiable-link" href="#How-to-Use-Inline-Assembly-Language-in-C-Code"> ¶</a></span></h1> <p>The <code class="code">asm</code> keyword allows you to embed assembler instructions within C code. GCC provides two forms of inline <code class="code">asm</code> statements. A <em class="dfn">basic <code class="code">asm</code></em> statement is one with no operands (see <a class="pxref" href="basic-asm">Basic Asm — Assembler Instructions Without Operands</a>), while an <em class="dfn">extended <code class="code">asm</code></em> statement (see <a class="pxref" href="extended-asm">Extended Asm - Assembler Instructions with C Expression Operands</a>) includes one or more operands. The extended form is preferred for mixing C and assembly language within a function, but to include assembly language at top level you must use basic <code class="code">asm</code>. </p> <p>You can also use the <code class="code">asm</code> keyword to override the assembler name for a C symbol, or to place a C variable in a specific register. </p> <ul class="mini-toc"> <li><a href="basic-asm" accesskey="1">Basic Asm — Assembler Instructions Without Operands</a></li> <li><a href="extended-asm" accesskey="2">Extended Asm - Assembler Instructions with C Expression Operands</a></li> <li><a href="constraints" accesskey="3">Constraints for <code class="code">asm</code> Operands</a></li> <li><a href="asm-labels" accesskey="4">Controlling Names Used in Assembler Code</a></li> <li><a href="explicit-register-variables" accesskey="5">Variables in Specified Registers</a></li> <li><a href="size-of-an-asm" accesskey="6">Size of an <code class="code">asm</code></a></li> </ul> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
+ <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Using-Assembly-Language-with-C.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Using-Assembly-Language-with-C.html</a>
+ </p>
+</div>