aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
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());
}
```