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.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/insn.rs') diff --git a/src/insn.rs b/src/insn.rs index 8c2215c..90ce444 100644 --- a/src/insn.rs +++ b/src/insn.rs @@ -15,6 +15,7 @@ mod nop; mod pop; mod push; mod ret; +mod sub; mod test; mod xor; @@ -91,16 +92,22 @@ pub trait Mov { fn mov(&mut self, op1: T, op2: U); } +/// Trait for [`pop`](https://www.felixcloutier.com/x86/pop) instruction kinds. +pub trait Pop { + /// Emit a pop instruction. + fn pop(&mut self, op1: T); +} + /// Trait for [`push`](https://www.felixcloutier.com/x86/push) instruction kinds. pub trait Push { /// Emit a push instruction. fn push(&mut self, op1: T); } -/// Trait for [`pop`](https://www.felixcloutier.com/x86/pop) instruction kinds. -pub trait Pop { - /// Emit a pop instruction. - fn pop(&mut self, op1: T); +/// Trait for [`sub`](https://www.felixcloutier.com/x86/sub) instruction kinds. +pub trait Sub { + /// Emit an sub instruction. + fn sub(&mut self, op1: T, op2: U); } /// Trait for [`test`](https://www.felixcloutier.com/x86/test) instruction kinds. -- cgit v1.2.3