From 36345d8ab93d23d9f94372863e3747a07222b6ce Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 6 Dec 2024 22:17:01 +0100 Subject: asm: add inc, xor insn and initial support for memory base+idx --- src/insn/add.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/insn/add.rs') diff --git a/src/insn/add.rs b/src/insn/add.rs index b8fe96c..d5312be 100644 --- a/src/insn/add.rs +++ b/src/insn/add.rs @@ -13,6 +13,12 @@ impl Add for Asm { } } +impl Add for Asm { + fn add(&mut self, op1: MemOp, op2: Reg64) { + self.encode_mr(0x01, op1, op2); + } +} + impl Add for Asm { fn add(&mut self, op1: MemOp, op2: Reg16) { self.encode_mr(0x01, op1, op2); @@ -24,3 +30,9 @@ impl Add for Asm { self.encode_mi(0x81, 0, op1, op2); } } + +impl Add for Asm { + fn add(&mut self, op1: Reg64, op2: MemOp) { + self.encode_rm(0x03, op1, op2); + } +} -- cgit v1.2.3