machina

Manage and execute assembly at runtime.
Crossplatform?
Yap.
Why?
Emulators, JIT, dynarec, etc.
Example
extern crate machina;
#[macro_use]
extern crate sam;
use machina::cache::{Cache, STUB};
use machina::memory::Memory;
fn main() {
let asm = format!("mov rax, {}", STUB); let dummy = 64;
let address = &dummy as *const _;
let cache = Cache::new(true); let memory = Memory::new(1); cache.insert("mov_rax_x".to_string(), sam!(x64 => &asm));
memory.emit_bytes(cache.get_stub("mov_rax_x", address as u64)) let rax = memory.execute(); }