Skip to content

parched/gcc-asm-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcc-asm

A Rust procedural macro for GCC style inline assembly. A work in progress, not fully compatible yet. Currently requires nightly.

Example usage

#![feature(proc_macro)]
#![feature(asm)]

extern crate gcc_asm;
use gcc_asm::gcc_asm;

fn add() {
    let a = 1;
    let b = 2;
    let c;
    unsafe {gcc_asm!("add %0, %1, %2" : "=r"(c) : "r"(a), "r"(b))};
    assert_eq!(3, c);
}

Supported and planned features

  • r constraint
  • i constraint
  • symbolic labels
  • %=
  • m constraint
  • volatile
  • clobbers
  • + constraint modifier

About

Procedural macro allowing use of GCC style inline assembly in Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages