Created
January 13, 2022 13:37
-
-
Save cho0h5/473f7f5b2a5e4b9c6cdf33724f433229 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(asm)] | |
fn main() { | |
use std::arch::asm; | |
let buf = "hello, world!\n"; | |
unsafe { | |
asm!("svc #0", | |
in("x0") 1, | |
in("x1") buf.as_ptr(), | |
in("x2") buf.len(), | |
in("x8") 64, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment