diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-12-07 23:00:09 +0100 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-12-07 23:00:09 +0100 |
commit | f4a9fdb3357ce1a2dfc12cbb0fee6b915bc810c4 (patch) | |
tree | f250376867477ac309d9fed4333224efe2d3969d /README.md | |
parent | 647e3646c2f686ce236059b935336c43c8a9a074 (diff) | |
download | juicebox-asm-f4a9fdb3357ce1a2dfc12cbb0fee6b915bc810c4.tar.gz juicebox-asm-f4a9fdb3357ce1a2dfc12cbb0fee6b915bc810c4.zip |
remove prelude
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -15,8 +15,9 @@ An `x64` jit assembler for learning purpose with the following two main goals: ## Example ```rust -use juicebox_asm::prelude::{Reg32::*, *}; +use juicebox_asm::insn::*; use juicebox_asm::Runtime; +use juicebox_asm::{Asm, Imm32, Label, Reg32::*}; fn main() { let mut asm = Asm::new(); @@ -45,8 +46,8 @@ fn main() { asm.ret(); - let rt = Runtime::new(&asm.into_code()); - let func = unsafe { rt.as_fn::<extern "C" fn() -> u32>() }; + let mut rt = Runtime::new(); + let func = unsafe { rt.add_code::<extern "C" fn() -> u32>(&asm.into_code()) }; assert_eq!(func(), (0..=42).into_iter().sum()); } ``` |