You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/inline-assembly.md
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,7 @@ On x86, the `.intel_syntax noprefix` mode of GAS is used by default.
87
87
On ARM, the `.syntax unified` mode is used.
88
88
These targets impose an additional restriction on the assembly code: any assembler state (e.g. the current section which can be changed with `.section`) must be restored to its original value at the end of the asm string.
89
89
Assembly code that does not conform to the GAS syntax will result in assembler-specific behavior.
90
-
Further constraints on the directives used by the assembly are indicated by [Directives Support](#directives-support).
90
+
Further constraints on the directives used by inline assembly are indicated by [Directives Support](#directives-support).
@@ -481,9 +481,11 @@ To avoid undefined behavior, these rules must be followed when using function-sc
481
481
482
482
### Directives Support
483
483
484
-
Inline ASM supports a subset of the directives supported by both GNU AS and LLVM's internal assembler, given as follows.
484
+
Inline assembly supports a subset of the directives supported by both GNU AS and LLVM's internal assembler, given as follows.
485
485
The result of using other directives is assembler-specific (and may cause an error, or may be accepted as-is).
486
486
487
+
If inline assembly includes any "stateful" directive that modifies how subsequent assembly is processed, the block must undo the effects of any such directives before the inline assembly ends.
488
+
487
489
The following directives are guaranteed to be supported by the assembler:
488
490
489
491
@@ -515,6 +517,7 @@ The following directives are guaranteed to be supported by the assembler:
515
517
-`.section`
516
518
-`.pushsection`
517
519
-`.popsection`
520
+
-`.subsection`
518
521
-`.text`
519
522
-`.bss`
520
523
-`.data`
@@ -584,9 +587,9 @@ On targets with structured exception Handling, the following additional directiv
584
587
-`.seh_stackalloc`
585
588
586
589
587
-
##### x86
590
+
##### x86 (32-bit and 64-bit)
588
591
589
-
On x86, the following additional directives are guaranteed to be supported:
592
+
On x86 targets, both 32-bit and 64-bit, the following additional directives are guaranteed to be supported:
590
593
-`.nops`
591
594
592
595
On x86 for `global_asm!` only, the following additional directives are guaranteed to be supported (it is unspecified whether `.code16` or `.code32` are supported for `asm!()`):
@@ -610,3 +613,4 @@ On ARM, the following additional directives are guaranteed to be supported:
0 commit comments