aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn/sub.rs
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-11 22:22:48 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2024-12-11 22:51:10 +0100
commit4f60de32bbba15a6fdad1cccbe43c638c3aef338 (patch)
tree90d45021e8f82f4176ec1d20dc18741046a8d8be /src/insn/sub.rs
parent7fa0970336a8ed489ae40f803554fd603cf3c8b5 (diff)
downloadjuicebox-asm-4f60de32bbba15a6fdad1cccbe43c638c3aef338.tar.gz
juicebox-asm-4f60de32bbba15a6fdad1cccbe43c638c3aef338.zip
asm: add sub insn, add imm8
Diffstat (limited to 'src/insn/sub.rs')
-rw-r--r--src/insn/sub.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/insn/sub.rs b/src/insn/sub.rs
new file mode 100644
index 0000000..814744c
--- /dev/null
+++ b/src/insn/sub.rs
@@ -0,0 +1,14 @@
+use super::Sub;
+use crate::{Asm, Imm8, MemOp, Reg64};
+
+impl Sub<Reg64, Reg64> for Asm {
+ fn sub(&mut self, op1: Reg64, op2: Reg64) {
+ self.encode_rr(&[0x29], op1, op2);
+ }
+}
+
+impl Sub<MemOp, Imm8> for Asm {
+ fn sub(&mut self, op1: MemOp, op2: Imm8) {
+ self.encode_mi(0x83, 5, op1, op2);
+ }
+}