From 4f60de32bbba15a6fdad1cccbe43c638c3aef338 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Wed, 11 Dec 2024 22:22:48 +0100 Subject: asm: add sub insn, add imm8 --- src/insn/sub.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/insn/sub.rs (limited to 'src/insn/sub.rs') 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 for Asm { + fn sub(&mut self, op1: Reg64, op2: Reg64) { + self.encode_rr(&[0x29], op1, op2); + } +} + +impl Sub for Asm { + fn sub(&mut self, op1: MemOp, op2: Imm8) { + self.encode_mi(0x83, 5, op1, op2); + } +} -- cgit v1.2.3