From e169a010c4942c610314a335e7c79f0cb421eef1 Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 5 Mar 2023 21:22:11 +0000 Subject: deploy: 8316b628bbc9945fd1d08305317cf49a6482801f --- implementors/juicebox_asm/insn/trait.Call.js | 3 +++ juicebox_asm/all.html | 2 +- juicebox_asm/enum.Reg64.html | 4 ++-- juicebox_asm/insn/trait.Call.html | 11 +++++++++++ juicebox_asm/prelude/enum.Reg64.html | 4 ++-- juicebox_asm/prelude/index.html | 2 +- juicebox_asm/prelude/sidebar-items.js | 2 +- juicebox_asm/prelude/trait.Add.html | 4 ++-- juicebox_asm/prelude/trait.Call.html | 4 ++++ juicebox_asm/prelude/trait.Dec.html | 4 ++-- juicebox_asm/prelude/trait.Jmp.html | 4 ++-- juicebox_asm/prelude/trait.Jnz.html | 4 ++-- juicebox_asm/prelude/trait.Jz.html | 4 ++-- juicebox_asm/prelude/trait.Mov.html | 4 ++-- juicebox_asm/prelude/trait.Test.html | 4 ++-- juicebox_asm/struct.Asm.html | 6 +++--- juicebox_asm/struct.Runtime.html | 6 +++--- search-index.js | 2 +- source-files.js | 2 +- src/juicebox_asm/insn.rs.html | 14 ++++++++++++++ src/juicebox_asm/insn/call.rs.html | 16 ++++++++++++++++ src/juicebox_asm/insn/nop.rs.html | 16 ++++++++++++++++ src/juicebox_asm/prelude.rs.html | 2 +- src/juicebox_asm/rt.rs.html | 6 ++++-- 24 files changed, 98 insertions(+), 32 deletions(-) create mode 100644 implementors/juicebox_asm/insn/trait.Call.js create mode 100644 juicebox_asm/insn/trait.Call.html create mode 100644 juicebox_asm/prelude/trait.Call.html create mode 100644 src/juicebox_asm/insn/call.rs.html create mode 100644 src/juicebox_asm/insn/nop.rs.html diff --git a/implementors/juicebox_asm/insn/trait.Call.js b/implementors/juicebox_asm/insn/trait.Call.js new file mode 100644 index 0000000..fccfcd2 --- /dev/null +++ b/implementors/juicebox_asm/insn/trait.Call.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"juicebox_asm":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/juicebox_asm/all.html b/juicebox_asm/all.html index 201b868..5d75fc5 100644 --- a/juicebox_asm/all.html +++ b/juicebox_asm/all.html @@ -1 +1 @@ -List of all items in this crate
\ No newline at end of file +List of all items in this crate
\ No newline at end of file diff --git a/juicebox_asm/enum.Reg64.html b/juicebox_asm/enum.Reg64.html index 75eaf41..26ae454 100644 --- a/juicebox_asm/enum.Reg64.html +++ b/juicebox_asm/enum.Reg64.html @@ -1,4 +1,4 @@ -Reg64 in juicebox_asm - Rust

Enum juicebox_asm::Reg64

source ·
#[repr(u8)]
+Reg64 in juicebox_asm - Rust

Enum juicebox_asm::Reg64

source ·
#[repr(u8)]
 pub enum Reg64 {
 
Show 16 variants rax, rcx, @@ -17,7 +17,7 @@ pub enum Reg64 { r14, r15,
}
Expand description

Definition of 64 bit registers.

-

Variants§

§

rax

§

rcx

§

rdx

§

rbx

§

rsp

§

rbp

§

rsi

§

rdi

§

r8

§

r9

§

r10

§

r11

§

r12

§

r13

§

r14

§

r15

Trait Implementations§

Emit an add instruction.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Emit a decrement instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit a logical compare instruction. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Variants§

§

rax

§

rcx

§

rdx

§

rbx

§

rsp

§

rbp

§

rsi

§

rdi

§

r8

§

r9

§

r10

§

r11

§

r12

§

r13

§

r14

§

r15

Trait Implementations§

Emit an add instruction.
Emit a call instruction.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Emit a decrement instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit a logical compare instruction. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/juicebox_asm/insn/trait.Call.html b/juicebox_asm/insn/trait.Call.html new file mode 100644 index 0000000..6bc842e --- /dev/null +++ b/juicebox_asm/insn/trait.Call.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../juicebox_asm/prelude/trait.Call.html...

+ + + \ No newline at end of file diff --git a/juicebox_asm/prelude/enum.Reg64.html b/juicebox_asm/prelude/enum.Reg64.html index 7682091..22a9446 100644 --- a/juicebox_asm/prelude/enum.Reg64.html +++ b/juicebox_asm/prelude/enum.Reg64.html @@ -1,4 +1,4 @@ -Reg64 in juicebox_asm::prelude - Rust
#[repr(u8)]
+Reg64 in juicebox_asm::prelude - Rust
#[repr(u8)]
 pub enum Reg64 {
 
Show 16 variants rax, rcx, @@ -17,7 +17,7 @@ pub enum Reg64 { r14, r15,
}
Expand description

Definition of 64 bit registers.

-

Variants§

§

rax

§

rcx

§

rdx

§

rbx

§

rsp

§

rbp

§

rsi

§

rdi

§

r8

§

r9

§

r10

§

r11

§

r12

§

r13

§

r14

§

r15

Trait Implementations§

Emit an add instruction.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Emit a decrement instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit a logical compare instruction. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Variants§

§

rax

§

rcx

§

rdx

§

rbx

§

rsp

§

rbp

§

rsi

§

rdi

§

r8

§

r9

§

r10

§

r11

§

r12

§

r13

§

r14

§

r15

Trait Implementations§

Emit an add instruction.
Emit a call instruction.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Emit a decrement instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit a logical compare instruction. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/juicebox_asm/prelude/index.html b/juicebox_asm/prelude/index.html index bc32b86..6e531ad 100644 --- a/juicebox_asm/prelude/index.html +++ b/juicebox_asm/prelude/index.html @@ -1,2 +1,2 @@ juicebox_asm::prelude - Rust

Module juicebox_asm::prelude

source ·
Expand description

Crate prelude, which can be used to import the most important types at once.

-

Re-exports

pub use crate::Asm;
pub use crate::MemOp;

Structs

Type representing an 8 bit immediate.
Type representing a 16 bit immediate.
Type representing a 32 bit immediate.
Type representing a 64 bit immediate.
A label which is used as target for jump instructions.

Enums

Definition of 8 bit registers.
Definition of 16 bit registers.
Definition of 32 bit registers.
Definition of 64 bit registers.

Traits

\ No newline at end of file +

Re-exports

pub use crate::Asm;
pub use crate::MemOp;

Structs

Type representing an 8 bit immediate.
Type representing a 16 bit immediate.
Type representing a 32 bit immediate.
Type representing a 64 bit immediate.
A label which is used as target for jump instructions.

Enums

Definition of 8 bit registers.
Definition of 16 bit registers.
Definition of 32 bit registers.
Definition of 64 bit registers.

Traits

\ No newline at end of file diff --git a/juicebox_asm/prelude/sidebar-items.js b/juicebox_asm/prelude/sidebar-items.js index 6491a87..ae3d156 100644 --- a/juicebox_asm/prelude/sidebar-items.js +++ b/juicebox_asm/prelude/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"enum":[["Reg16","Definition of 16 bit registers."],["Reg32","Definition of 32 bit registers."],["Reg64","Definition of 64 bit registers."],["Reg8","Definition of 8 bit registers."]],"struct":[["Imm16","Type representing a 16 bit immediate."],["Imm32","Type representing a 32 bit immediate."],["Imm64","Type representing a 64 bit immediate."],["Imm8","Type representing an 8 bit immediate."],["Label","A label which is used as target for jump instructions."]],"trait":[["Add",""],["Dec",""],["Jmp",""],["Jnz",""],["Jz",""],["Mov",""],["Test",""]]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"enum":[["Reg16","Definition of 16 bit registers."],["Reg32","Definition of 32 bit registers."],["Reg64","Definition of 64 bit registers."],["Reg8","Definition of 8 bit registers."]],"struct":[["Imm16","Type representing a 16 bit immediate."],["Imm32","Type representing a 32 bit immediate."],["Imm64","Type representing a 64 bit immediate."],["Imm8","Type representing an 8 bit immediate."],["Label","A label which is used as target for jump instructions."]],"trait":[["Add",""],["Call",""],["Dec",""],["Jmp",""],["Jnz",""],["Jz",""],["Mov",""],["Test",""]]}; \ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Add.html b/juicebox_asm/prelude/trait.Add.html index 38d3ac0..456a3b4 100644 --- a/juicebox_asm/prelude/trait.Add.html +++ b/juicebox_asm/prelude/trait.Add.html @@ -1,4 +1,4 @@ -Add in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Add

source ·
pub trait Add<T, U> {
+Add in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Add

source ·
pub trait Add<T, U> {
     fn add(&mut self, op1: T, op2: U);
-}

Required Methods§

Emit an add instruction.

+}

Required Methods§

Emit an add instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Call.html b/juicebox_asm/prelude/trait.Call.html new file mode 100644 index 0000000..6670646 --- /dev/null +++ b/juicebox_asm/prelude/trait.Call.html @@ -0,0 +1,4 @@ +Call in juicebox_asm::prelude - Rust
pub trait Call<T> {
+    fn call(&mut self, op1: T);
+}

Required Methods§

Emit a call instruction.

+

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Dec.html b/juicebox_asm/prelude/trait.Dec.html index d99761d..f3f3c9f 100644 --- a/juicebox_asm/prelude/trait.Dec.html +++ b/juicebox_asm/prelude/trait.Dec.html @@ -1,4 +1,4 @@ -Dec in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Dec

source ·
pub trait Dec<T> {
+Dec in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Dec

source ·
pub trait Dec<T> {
     fn dec(&mut self, op1: T);
-}

Required Methods§

Emit a decrement instruction.

+}

Required Methods§

Emit a decrement instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Jmp.html b/juicebox_asm/prelude/trait.Jmp.html index 282a71c..3fc8c46 100644 --- a/juicebox_asm/prelude/trait.Jmp.html +++ b/juicebox_asm/prelude/trait.Jmp.html @@ -1,4 +1,4 @@ -Jmp in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Jmp

source ·
pub trait Jmp<T> {
+Jmp in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Jmp

source ·
pub trait Jmp<T> {
     fn jmp(&mut self, op1: T);
-}

Required Methods§

Emit an unconditional jump instruction.

+}

Required Methods§

Emit an unconditional jump instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Jnz.html b/juicebox_asm/prelude/trait.Jnz.html index a1172bd..7131663 100644 --- a/juicebox_asm/prelude/trait.Jnz.html +++ b/juicebox_asm/prelude/trait.Jnz.html @@ -1,4 +1,4 @@ -Jnz in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Jnz

source ·
pub trait Jnz<T> {
+Jnz in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Jnz

source ·
pub trait Jnz<T> {
     fn jnz(&mut self, op1: T);
-}

Required Methods§

Emit a conditional jump if not zero instruction (ZF = 0).

+}

Required Methods§

Emit a conditional jump if not zero instruction (ZF = 0).

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Jz.html b/juicebox_asm/prelude/trait.Jz.html index 6e7d6fb..8b21b61 100644 --- a/juicebox_asm/prelude/trait.Jz.html +++ b/juicebox_asm/prelude/trait.Jz.html @@ -1,4 +1,4 @@ -Jz in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Jz

source ·
pub trait Jz<T> {
+Jz in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Jz

source ·
pub trait Jz<T> {
     fn jz(&mut self, op1: T);
-}

Required Methods§

Emit a conditional jump if zero instruction (ZF = 1).

+}

Required Methods§

Emit a conditional jump if zero instruction (ZF = 1).

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Mov.html b/juicebox_asm/prelude/trait.Mov.html index 453e913..2e1b751 100644 --- a/juicebox_asm/prelude/trait.Mov.html +++ b/juicebox_asm/prelude/trait.Mov.html @@ -1,4 +1,4 @@ -Mov in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Mov

source ·
pub trait Mov<T, U> {
+Mov in juicebox_asm::prelude - Rust

Trait juicebox_asm::prelude::Mov

source ·
pub trait Mov<T, U> {
     fn mov(&mut self, op1: T, op2: U);
-}

Required Methods§

Emit an move instruction.

+}

Required Methods§

Emit an move instruction.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/prelude/trait.Test.html b/juicebox_asm/prelude/trait.Test.html index 7ac23e5..5a01841 100644 --- a/juicebox_asm/prelude/trait.Test.html +++ b/juicebox_asm/prelude/trait.Test.html @@ -1,6 +1,6 @@ -Test in juicebox_asm::prelude - Rust
pub trait Test<T, U> {
+Test in juicebox_asm::prelude - Rust
pub trait Test<T, U> {
     fn test(&mut self, op1: T, op2: U);
-}

Required Methods§

Emit a logical compare instruction.

+}

Required Methods§

Emit a logical compare instruction.

Computes the bit-wise logical AND of first operand and the second operand and sets the SF, ZF, and PF status flags, the result is discarded.

Implementors§

\ No newline at end of file diff --git a/juicebox_asm/struct.Asm.html b/juicebox_asm/struct.Asm.html index 31abbb5..c3da6eb 100644 --- a/juicebox_asm/struct.Asm.html +++ b/juicebox_asm/struct.Asm.html @@ -1,9 +1,9 @@ -Asm in juicebox_asm - Rust

Struct juicebox_asm::Asm

source ·
pub struct Asm { /* private fields */ }
Expand description

x64 jit assembler.

-

Implementations§

Create a new x64 jit assembler.

+Asm in juicebox_asm - Rust

Struct juicebox_asm::Asm

source ·
pub struct Asm { /* private fields */ }
Expand description

x64 jit assembler.

+

Implementations§

Create a new x64 jit assembler.

Consume the assembler and get the emitted code.

Bind the Label to the current location.

If the Label is bound, patch any pending relocation.

-

Trait Implementations§

Emit an add instruction.
Emit an add instruction.
Emit a decrement instruction.
Emit a decrement instruction.
Emit an unconditional jump instruction.
Emit a conditional jump if not zero instruction (ZF = 0).
Emit a conditional jump if zero instruction (ZF = 1).
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit a logical compare instruction. Read more
Emit a logical compare instruction. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Trait Implementations§

Emit an add instruction.
Emit an add instruction.
Emit a call instruction.
Emit a decrement instruction.
Emit a decrement instruction.
Emit an unconditional jump instruction.
Emit a conditional jump if not zero instruction (ZF = 0).
Emit a conditional jump if zero instruction (ZF = 1).
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit an move instruction.
Emit a logical compare instruction. Read more
Emit a logical compare instruction. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/juicebox_asm/struct.Runtime.html b/juicebox_asm/struct.Runtime.html index 9f0da89..d221e22 100644 --- a/juicebox_asm/struct.Runtime.html +++ b/juicebox_asm/struct.Runtime.html @@ -1,7 +1,7 @@ Runtime in juicebox_asm - Rust

Struct juicebox_asm::Runtime

source ·
pub struct Runtime { /* private fields */ }
Expand description

A simple mmaped runtime with executable pages.

-

Implementations§

Create a new Runtime.

-

Reinterpret the block of code as F.

-

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Implementations§

Create a new Runtime.

+

Reinterpret the block of code as F.

+

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

diff --git a/search-index.js b/search-index.js index 1bfce2f..cd9e86f 100644 --- a/search-index.js +++ b/search-index.js @@ -1,5 +1,5 @@ var searchIndex = JSON.parse('{\ -"juicebox_asm":{"doc":"A simple x64 jit assembler with a minimal runtime to …","t":[3,3,3,3,3,13,13,3,4,4,4,4,4,3,11,11,13,13,11,13,13,11,13,11,11,11,11,11,11,13,13,13,13,13,13,11,11,13,13,13,13,11,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,11,11,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,8,2,8,3,3,3,3,8,8,8,3,2,8,4,4,4,4,8,10,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,13,13,13,13,11,11,11,11,11,11,11,11,13,10,13,13,13,13,11,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,10,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Asm","Imm16","Imm32","Imm64","Imm8","Indirect","IndirectDisp","Label","MemOp","Reg16","Reg32","Reg64","Reg8","Runtime","add","add","ah","al","as_fn","ax","bh","bind","bl","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","bp","bpl","bx","ch","cl","cx","dec","dec","dh","di","dil","dl","drop","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","from","from","into","into","into","into_code","jmp","jnz","jz","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","new","new","prelude","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","resolve","ret","rsi","rsp","si","sil","sp","spl","test","test","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","Add","Asm","Dec","Imm16","Imm32","Imm64","Imm8","Jmp","Jnz","Jz","Label","MemOp","Mov","Reg16","Reg32","Reg64","Reg8","Test","add","ah","al","ax","bh","bl","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bp","bpl","bx","ch","cl","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cx","dec","dh","di","dil","dl","drop","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","jmp","jnz","jz","mov","new","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","rsi","rsp","si","sil","sp","spl","test","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id"],"q":["juicebox_asm","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","juicebox_asm::prelude","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["x64 jit assembler.","Type representing a 16 bit immediate.","Type representing a 32 bit immediate.","Type representing a 64 bit immediate.","Type representing an 8 bit immediate.","An indirect memory operand, eg mov [rax], rcx.","An indirect memory operand with additional displacement, …","A label which is used as target for jump instructions.","Type representing a memory operand.","Definition of 16 bit registers.","Definition of 32 bit registers.","Definition of 64 bit registers.","Definition of 8 bit registers.","A simple mmaped runtime with executable pages.","","","","","Reinterpret the block of code as F.","","","Bind the Label to the current location.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Consume the assembler and get the emitted code.","","","","","","","","","","","","","","","","","","","","Create a new Runtime.","Create a new x64 jit assembler.","Crate prelude, which can be used to import the most …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If the Label is bound, patch any pending relocation.","","","","","","","","","","","","","","","","","","","","","","Type representing a 16 bit immediate.","Type representing a 32 bit immediate.","Type representing a 64 bit immediate.","Type representing an 8 bit immediate.","","","","A label which is used as target for jump instructions.","","","Definition of 16 bit registers.","Definition of 32 bit registers.","Definition of 64 bit registers.","Definition of 8 bit registers.","","Emit an add instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Emit a decrement instruction.","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","Returns the argument unchanged.","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Emit an unconditional jump instruction.","Emit a conditional jump if not zero instruction (ZF = 0).","Emit a conditional jump if zero instruction (ZF = 1).","Emit an move instruction.","Create a new unbound Label.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Emit a logical compare instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,13,13,0,0,0,0,0,0,0,1,1,8,8,4,11,8,1,8,4,13,1,4,13,1,11,8,11,8,8,11,1,1,8,11,8,8,4,11,3,3,3,3,3,3,3,3,4,13,1,4,13,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,0,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,2,2,2,2,2,1,1,2,2,11,8,11,8,1,1,4,13,1,4,13,1,4,13,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,8,8,11,8,8,5,9,12,10,14,2,3,11,8,5,9,12,10,14,2,3,11,8,11,8,11,8,8,2,3,11,8,2,3,11,8,11,25,8,11,8,8,5,11,3,3,3,3,3,3,3,3,5,9,9,9,12,12,12,12,12,10,10,10,10,10,10,10,14,14,14,14,14,14,14,14,14,2,3,11,8,5,9,12,10,14,2,3,11,8,26,27,28,29,5,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,3,8,11,2,2,2,2,2,2,2,2,11,8,11,8,30,2,3,11,8,5,9,12,10,14,2,3,11,8,5,9,12,10,14,2,3,11,8,5,9,12,10,14,2,3,11,8],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,2]],[[1,3,3]],0,0,[4],0,0,[[1,5]],0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,0,[[1,2]],[[1,3]],0,0,0,0,[4],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[1,[[7,[6]]]],[[1,5]],[[1,5]],[[1,5]],[[1,8,9]],[[1,2,2]],[[1,3,10]],[[1,3,3]],[[1,11,11]],[[1,11,12]],[[1,8,8]],[[1,13,2]],[[1,13,3]],[[1,13,11]],[[1,13,8]],[[1,2,13]],[[1,3,13]],[[1,11,13]],[[1,8,13]],[[1,2,14]],[[],4],[[],1],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,5]],[1],0,0,0,0,0,0,[[1,2,2]],[[1,3,3]],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],16],[[],16],[[],16],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,0,0,[2,2],[3,3],[11,11],[8,8],[[]],[[]],[[]],[[]],0,[[]],0,0,0,0,[5],0,0,0,0,0,0,0,0,0,[[]],[17,9],[[]],[6,9],[17,12],[18,12],[19,12],[6,12],[[]],[[]],[20,10],[21,10],[18,10],[19,10],[6,10],[17,10],[20,14],[18,14],[19,14],[[]],[6,14],[17,14],[22,14],[23,14],[21,14],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16]],"p":[[3,"Asm"],[4,"Reg64"],[4,"Reg32"],[3,"Runtime"],[3,"Label"],[15,"u8"],[3,"Vec"],[4,"Reg8"],[3,"Imm8"],[3,"Imm32"],[4,"Reg16"],[3,"Imm16"],[4,"MemOp"],[3,"Imm64"],[4,"Result"],[3,"TypeId"],[15,"i8"],[15,"u16"],[15,"i16"],[15,"u32"],[15,"i32"],[15,"u64"],[15,"i64"],[8,"Add"],[8,"Dec"],[8,"Jmp"],[8,"Jnz"],[8,"Jz"],[8,"Mov"],[8,"Test"]]}\ +"juicebox_asm":{"doc":"A simple x64 jit assembler with a minimal runtime to …","t":[3,3,3,3,3,13,13,3,4,4,4,4,4,3,11,11,13,13,11,13,13,11,13,11,11,11,11,11,11,13,13,13,11,13,13,13,11,11,13,13,13,13,11,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,0,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,11,11,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,8,2,8,8,3,3,3,3,8,8,8,3,2,8,4,4,4,4,8,10,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,13,13,13,10,13,13,11,11,11,11,11,11,11,11,13,10,13,13,13,13,11,13,13,13,13,13,13,13,13,13,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10,10,10,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11],"n":["Asm","Imm16","Imm32","Imm64","Imm8","Indirect","IndirectDisp","Label","MemOp","Reg16","Reg32","Reg64","Reg8","Runtime","add","add","ah","al","as_fn","ax","bh","bind","bl","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","bp","bpl","bx","call","ch","cl","cx","dec","dec","dh","di","dil","dl","drop","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","from","from","into","into","into","into_code","jmp","jnz","jz","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","mov","new","new","nop","prelude","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","resolve","ret","rsi","rsp","si","sil","sp","spl","test","test","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","Add","Asm","Call","Dec","Imm16","Imm32","Imm64","Imm8","Jmp","Jnz","Jz","Label","MemOp","Mov","Reg16","Reg32","Reg64","Reg8","Test","add","ah","al","ax","bh","bl","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","bp","bpl","bx","call","ch","cl","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","cx","dec","dh","di","dil","dl","drop","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","into","into","into","into","jmp","jnz","jz","mov","new","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","rsi","rsp","si","sil","sp","spl","test","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id"],"q":["juicebox_asm","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","juicebox_asm::prelude","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"d":["x64 jit assembler.","Type representing a 16 bit immediate.","Type representing a 32 bit immediate.","Type representing a 64 bit immediate.","Type representing an 8 bit immediate.","An indirect memory operand, eg mov [rax], rcx.","An indirect memory operand with additional displacement, …","A label which is used as target for jump instructions.","Type representing a memory operand.","Definition of 16 bit registers.","Definition of 32 bit registers.","Definition of 64 bit registers.","Definition of 8 bit registers.","A simple mmaped runtime with executable pages.","","","","","Reinterpret the block of code as F.","","","Bind the Label to the current location.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Consume the assembler and get the emitted code.","","","","","","","","","","","","","","","","","","","","Create a new Runtime.","Create a new x64 jit assembler.","","Crate prelude, which can be used to import the most …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","If the Label is bound, patch any pending relocation.","","","","","","","","","","","","","","","","","","","","","","","Type representing a 16 bit immediate.","Type representing a 32 bit immediate.","Type representing a 64 bit immediate.","Type representing an 8 bit immediate.","","","","A label which is used as target for jump instructions.","","","Definition of 16 bit registers.","Definition of 32 bit registers.","Definition of 64 bit registers.","Definition of 8 bit registers.","","Emit an add instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","Emit a call instruction.","","","","","","","","","","","","Emit a decrement instruction.","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Emit an unconditional jump instruction.","Emit a conditional jump if not zero instruction (ZF = 0).","Emit a conditional jump if zero instruction (ZF = 1).","Emit an move instruction.","Create a new unbound Label.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Emit a logical compare instruction.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,8,8,0,0,0,0,0,0,0,1,1,10,10,4,9,10,1,10,4,8,1,4,8,1,9,10,9,1,10,10,9,1,1,10,9,10,10,4,9,3,3,3,3,3,3,3,3,4,8,1,4,8,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,4,1,1,0,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,2,2,2,2,2,1,1,2,2,9,10,9,10,1,1,4,8,1,4,8,1,4,8,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,10,10,9,10,10,5,14,13,12,11,2,3,9,10,5,14,13,12,11,2,3,9,10,9,10,9,26,10,10,2,3,9,10,2,3,9,10,9,27,10,9,10,10,5,9,3,3,3,3,3,3,3,3,5,14,14,14,13,13,13,13,13,12,12,12,12,12,12,12,11,11,11,11,11,11,11,11,11,2,3,9,10,5,14,13,12,11,2,3,9,10,28,29,30,31,5,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,3,10,9,2,2,2,2,2,2,2,2,9,10,9,10,32,2,3,9,10,5,14,13,12,11,2,3,9,10,5,14,13,12,11,2,3,9,10,5,14,13,12,11,2,3,9,10],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,2,2]],[[1,3,3]],0,0,[4],0,0,[[1,5]],0,[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,[[1,2]],0,0,0,[[1,3]],[[1,2]],0,0,0,0,[4],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[1,[[7,[6]]]],[[1,5]],[[1,5]],[[1,5]],[[1,8,3]],[[1,8,9]],[[1,9,9]],[[1,8,2]],[[1,10,10]],[[1,8,10]],[[1,2,8]],[[1,3,8]],[[1,9,8]],[[1,10,8]],[[1,2,11]],[[1,2,2]],[[1,3,12]],[[1,9,13]],[[1,3,3]],[[1,10,14]],[15,4],[[],1],[1],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[1,5]],[1],0,0,0,0,0,0,[[1,3,3]],[[1,2,2]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],17],[[],17],[[],17],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],0,0,0,[[]],0,0,[2,2],[3,3],[9,9],[10,10],[[]],[[]],[[]],[[]],0,[[]],0,0,0,0,[5],0,0,0,0,0,0,0,0,0,[[]],[18,14],[[]],[6,14],[[]],[19,13],[18,13],[6,13],[20,13],[19,12],[20,12],[6,12],[18,12],[21,12],[[]],[22,12],[23,11],[18,11],[[]],[24,11],[22,11],[21,11],[19,11],[20,11],[6,11],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],5],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],16],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17],[[],17]],"p":[[3,"Asm"],[4,"Reg64"],[4,"Reg32"],[3,"Runtime"],[3,"Label"],[15,"u8"],[3,"Vec"],[4,"MemOp"],[4,"Reg16"],[4,"Reg8"],[3,"Imm64"],[3,"Imm32"],[3,"Imm16"],[3,"Imm8"],[8,"AsRef"],[4,"Result"],[3,"TypeId"],[15,"i8"],[15,"u16"],[15,"i16"],[15,"i32"],[15,"u32"],[15,"i64"],[15,"u64"],[8,"Add"],[8,"Call"],[8,"Dec"],[8,"Jmp"],[8,"Jnz"],[8,"Jz"],[8,"Mov"],[8,"Test"]]}\ }'); if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/source-files.js b/source-files.js index 850f313..90705da 100644 --- a/source-files.js +++ b/source-files.js @@ -1,4 +1,4 @@ var sourcesIndex = JSON.parse('{\ -"juicebox_asm":["",[["insn",[],["add.rs","dec.rs","jmp.rs","jnz.rs","jz.rs","mov.rs","ret.rs","test.rs"]]],["imm.rs","insn.rs","label.rs","lib.rs","prelude.rs","reg.rs","rt.rs"]]\ +"juicebox_asm":["",[["insn",[],["add.rs","call.rs","dec.rs","jmp.rs","jnz.rs","jz.rs","mov.rs","nop.rs","ret.rs","test.rs"]]],["imm.rs","insn.rs","label.rs","lib.rs","prelude.rs","reg.rs","rt.rs"]]\ }'); createSourceSidebar(); diff --git a/src/juicebox_asm/insn.rs.html b/src/juicebox_asm/insn.rs.html index 2affb2d..fd7a473 100644 --- a/src/juicebox_asm/insn.rs.html +++ b/src/juicebox_asm/insn.rs.html @@ -46,14 +46,23 @@ 46 47 48 +49 +50 +51 +52 +53 +54 +55
//! Trait definitions of various instructions.
 
 mod add;
+mod call;
 mod dec;
 mod jmp;
 mod jnz;
 mod jz;
 mod mov;
+mod nop;
 mod ret;
 mod test;
 
@@ -62,6 +71,11 @@
     fn add(&mut self, op1: T, op2: U);
 }
 
+pub trait Call<T> {
+    /// Emit a call instruction.
+    fn call(&mut self, op1: T);
+}
+
 pub trait Dec<T> {
     /// Emit a decrement instruction.
     fn dec(&mut self, op1: T);
diff --git a/src/juicebox_asm/insn/call.rs.html b/src/juicebox_asm/insn/call.rs.html
new file mode 100644
index 0000000..c9d073e
--- /dev/null
+++ b/src/juicebox_asm/insn/call.rs.html
@@ -0,0 +1,16 @@
+call.rs - source
1
+2
+3
+4
+5
+6
+7
+
use crate::prelude::*;
+
+impl Call<Reg64> for Asm {
+    fn call(&mut self, op1: Reg64) {
+        self.encode_r(0xff, 0x2, op1);
+    }
+}
+
+
\ No newline at end of file diff --git a/src/juicebox_asm/insn/nop.rs.html b/src/juicebox_asm/insn/nop.rs.html new file mode 100644 index 0000000..49a1571 --- /dev/null +++ b/src/juicebox_asm/insn/nop.rs.html @@ -0,0 +1,16 @@ +nop.rs - source
1
+2
+3
+4
+5
+6
+7
+
use crate::Asm;
+
+impl Asm {
+    pub fn nop(&mut self) {
+        self.emit(&[0x90]);
+    }
+}
+
+
\ No newline at end of file diff --git a/src/juicebox_asm/prelude.rs.html b/src/juicebox_asm/prelude.rs.html index be1334b..a066379 100644 --- a/src/juicebox_asm/prelude.rs.html +++ b/src/juicebox_asm/prelude.rs.html @@ -17,6 +17,6 @@ pub use crate::label::Label; pub use crate::reg::{Reg16, Reg32, Reg64, Reg8}; -pub use crate::insn::{Add, Dec, Jmp, Jnz, Jz, Mov, Test}; +pub use crate::insn::{Add, Call, Dec, Jmp, Jnz, Jz, Mov, Test};
\ No newline at end of file diff --git a/src/juicebox_asm/rt.rs.html b/src/juicebox_asm/rt.rs.html index 62ee9b7..254745c 100644 --- a/src/juicebox_asm/rt.rs.html +++ b/src/juicebox_asm/rt.rs.html @@ -51,6 +51,7 @@ 51 52 53 +54
//! A simple runtime which can be used to execute emitted instructions.
 
 use core::ffi::c_void;
@@ -64,7 +65,7 @@
 
 impl Runtime {
     /// Create a new [Runtime].
-    pub fn new(code: &[u8]) -> Runtime {
+    pub fn new(code: impl AsRef<[u8]>) -> Runtime {
         // Allocate a single page.
         let len = core::num::NonZeroUsize::new(4096).unwrap();
         let buf = unsafe {
@@ -80,7 +81,8 @@
         };
         {
             // Copy over code.
-            assert!(code.len() < len.get());
+            let code = code.as_ref();
+            assert!(code.len() < len.get());
             unsafe { std::ptr::copy_nonoverlapping(code.as_ptr(), buf.cast(), len.get()) };
         }
 
-- 
cgit v1.2.3