Skip to content

Instantly share code, notes, and snippets.

View skariel's full-sized avatar
🎯
Focusing

Ariel Keselman skariel

🎯
Focusing
  • Huawei / Senior Software Architect
  • Haifa, Israel
View GitHub Profile
@luqmana
luqmana / Rust Inline Asm.md
Last active February 1, 2022 03:29
How to use inline assembly in Rust.
fn main() {
    unsafe {
        do str::as_c_str(~"The answer is %d.\n") |c| {
            let a = 42;
            asm!("mov $0, %rdi\n\t\
                  mov $1, %rsi\n\t\
                  xorl %eax, %eax\n\t\
                  call _printf"
                 :