aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-12-07 23:00:09 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-12-07 23:00:09 +0100
commitf4a9fdb3357ce1a2dfc12cbb0fee6b915bc810c4 (patch)
treef250376867477ac309d9fed4333224efe2d3969d /README.md
parent647e3646c2f686ce236059b935336c43c8a9a074 (diff)
downloadjuicebox-asm-f4a9fdb3357ce1a2dfc12cbb0fee6b915bc810c4.tar.gz
juicebox-asm-f4a9fdb3357ce1a2dfc12cbb0fee6b915bc810c4.zip
remove prelude
Diffstat (limited to 'README.md')
-rw-r--r--README.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/README.md b/README.md
index ebb4b28..d0760d2 100644
--- a/README.md
+++ b/README.md
@@ -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());
}
```