Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/inline-assembly.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ core::arch::naked_asm!("/* {} */", const 0);
r[asm.scope.global_asm]
With the `global_asm!` macro, the assembly code is emitted in a global scope, outside a function. This can be used to hand-write entire functions using assembly code, and generally provides much more freedom to use arbitrary registers and assembler directives.

The `global_asm!` macro may only appear in [Item] position --- that is, in the crate root or a module, or as a statement.

```rust
# fn main() {}
# #[cfg(target_arch = "x86_64")]
Expand Down
Loading