aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn
diff options
context:
space:
mode:
Diffstat (limited to 'src/insn')
-rw-r--r--src/insn/add.rs6
-rw-r--r--src/insn/dec.rs6
-rw-r--r--src/insn/jnz.rs7
-rw-r--r--src/insn/test.rs6
4 files changed, 25 insertions, 0 deletions
diff --git a/src/insn/add.rs b/src/insn/add.rs
index b8456c4..3757d14 100644
--- a/src/insn/add.rs
+++ b/src/insn/add.rs
@@ -5,3 +5,9 @@ impl Add<Reg64, Reg64> for Asm {
self.encode_rr(0x01, op1, op2);
}
}
+
+impl Add<Reg32, Reg32> for Asm {
+ fn add(&mut self, op1: Reg32, op2: Reg32) {
+ self.encode_rr(0x01, op1, op2);
+ }
+}
diff --git a/src/insn/dec.rs b/src/insn/dec.rs
index 7de5a54..c5803e7 100644
--- a/src/insn/dec.rs
+++ b/src/insn/dec.rs
@@ -5,3 +5,9 @@ impl Dec<Reg64> for Asm {
self.encode_r(0xff, 1, op1);
}
}
+
+impl Dec<Reg32> for Asm {
+ fn dec(&mut self, op1: Reg32) {
+ self.encode_r(0xff, 1, op1);
+ }
+}
diff --git a/src/insn/jnz.rs b/src/insn/jnz.rs
new file mode 100644
index 0000000..6517bd7
--- /dev/null
+++ b/src/insn/jnz.rs
@@ -0,0 +1,7 @@
+use crate::prelude::*;
+
+impl Jnz<&mut Label> for Asm {
+ fn jnz(&mut self, op1: &mut Label) {
+ self.encode_jmp_label(&[0x0f, 0x85], op1);
+ }
+}
diff --git a/src/insn/test.rs b/src/insn/test.rs
index 1319e3f..25f1680 100644
--- a/src/insn/test.rs
+++ b/src/insn/test.rs
@@ -5,3 +5,9 @@ impl Test<Reg64, Reg64> for Asm {
self.encode_rr(0x85, op1, op2);
}
}
+
+impl Test<Reg32, Reg32> for Asm {
+ fn test(&mut self, op1: Reg32, op2: Reg32) {
+ self.encode_rr(0x85, op1, op2);
+ }
+}