aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/insn.rs2
-rw-r--r--src/insn/mov.rs2
-rw-r--r--src/lib.rs11
-rw-r--r--src/prelude.rs (renamed from src/insn/prelude.rs)2
-rw-r--r--tests/mov.rs4
5 files changed, 5 insertions, 16 deletions
diff --git a/src/insn.rs b/src/insn.rs
index 7c74dd9..c0bcc4e 100644
--- a/src/insn.rs
+++ b/src/insn.rs
@@ -1,5 +1,3 @@
-mod prelude;
-
mod mov;
pub trait Mov<T, U> {
diff --git a/src/insn/mov.rs b/src/insn/mov.rs
index d930ade..bf1c33e 100644
--- a/src/insn/mov.rs
+++ b/src/insn/mov.rs
@@ -1,4 +1,4 @@
-use super::prelude::*;
+use crate::prelude::*;
// -- MOV : reg reg
diff --git a/src/lib.rs b/src/lib.rs
index 9eb2583..e38da14 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,3 +1,5 @@
+pub mod prelude;
+
mod imm;
mod insn;
mod reg;
@@ -7,8 +9,6 @@ pub use imm::{Imm16, Imm32, Imm64, Imm8};
use reg::Reg;
pub use reg::{Reg16, Reg32, Reg64, Reg8};
-use insn::Mov;
-
pub enum MemOp {
Indirect(Reg64),
IndirectDisp(Reg64, i32),
@@ -69,13 +69,6 @@ impl Asm {
}
}
- pub fn mov<T, U>(&mut self, op1: T, op2: U)
- where
- Self: Mov<T, U>,
- {
- <Self as Mov<T, U>>::mov(self, op1, op2);
- }
-
fn encode_rr<T: Reg>(&mut self, opc: u8, op1: T, op2: T)
where
Self: EncodeRR<T>,
diff --git a/src/insn/prelude.rs b/src/prelude.rs
index 703417a..d1cd794 100644
--- a/src/insn/prelude.rs
+++ b/src/prelude.rs
@@ -3,4 +3,4 @@ pub use crate::MemOp;
pub use crate::{Imm16, Imm32, Imm64, Imm8};
pub use crate::{Reg16, Reg32, Reg64, Reg8};
-pub use crate::insn::Mov;
+pub use crate::insn::{Add, Mov};
diff --git a/tests/mov.rs b/tests/mov.rs
index fce50a1..903bd5f 100644
--- a/tests/mov.rs
+++ b/tests/mov.rs
@@ -1,6 +1,4 @@
-use juicebox_asm::Asm;
-use juicebox_asm::MemOp;
-use juicebox_asm::{Imm16, Imm32, Imm64, Imm8};
+use juicebox_asm::prelude::*;
use juicebox_asm::{Reg16::*, Reg32::*, Reg64::*, Reg8::*};
macro_rules! mov {