x64asm
Library to write x64 Assembly code from Rust, more properly. Designed for the nasm assembler
How to use
let instructions = vec!;
let code = instructions.to_assembly;
// Writes to a file
let mut stream = create.unwrap;
write!.unwrap;
Installation
In your "Cargo.toml" file :
[]
= "*"
Check the current version on crates.io
Example
let instructions = vec!;
let code = instructions.to_assembly;
let mut stream = create.unwrap;
write!.unwrap;
use Path;
use File;
use *;
use ;
use *;
And then, the generated "output.asm" file :
global _start
section .text
_start:
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, msg_len
syscall
mov rax, 60
mov rdi, 0
syscall
section .data
msg: db `Hello world`
msg_len: equ $ - msg
Notes
Originally inspired by GregoryComer/rust-x86asm.