aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn
diff options
context:
space:
mode:
Diffstat (limited to 'src/insn')
-rw-r--r--src/insn/pop.rs14
-rw-r--r--src/insn/push.rs14
2 files changed, 28 insertions, 0 deletions
diff --git a/src/insn/pop.rs b/src/insn/pop.rs
new file mode 100644
index 0000000..c8cc5b5
--- /dev/null
+++ b/src/insn/pop.rs
@@ -0,0 +1,14 @@
+use super::Pop;
+use crate::{Asm, Reg16, Reg64};
+
+impl Pop<Reg64> for Asm {
+ fn pop(&mut self, op1: Reg64) {
+ self.encode_r(0x8f, 0x0, op1);
+ }
+}
+
+impl Pop<Reg16> for Asm {
+ fn pop(&mut self, op1: Reg16) {
+ self.encode_r(0x8f, 0x0, op1);
+ }
+}
diff --git a/src/insn/push.rs b/src/insn/push.rs
new file mode 100644
index 0000000..8554dcb
--- /dev/null
+++ b/src/insn/push.rs
@@ -0,0 +1,14 @@
+use super::Push;
+use crate::{Asm, Reg16, Reg64};
+
+impl Push<Reg64> for Asm {
+ fn push(&mut self, op1: Reg64) {
+ self.encode_r(0xff, 0x6, op1);
+ }
+}
+
+impl Push<Reg16> for Asm {
+ fn push(&mut self, op1: Reg16) {
+ self.encode_r(0xff, 0x6, op1);
+ }
+}