aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/insn.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.rs
parent7fa0970336a8ed489ae40f803554fd603cf3c8b5 (diff)
downloadjuicebox-asm-4f60de32bbba15a6fdad1cccbe43c638c3aef338.tar.gz
juicebox-asm-4f60de32bbba15a6fdad1cccbe43c638c3aef338.zip
asm: add sub insn, add imm8
Diffstat (limited to 'src/insn.rs')
-rw-r--r--src/insn.rs15
1 files changed, 11 insertions, 4 deletions
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<T, U> {
fn mov(&mut self, op1: T, op2: U);
}
+/// Trait for [`pop`](https://www.felixcloutier.com/x86/pop) instruction kinds.
+pub trait Pop<T> {
+ /// Emit a pop instruction.
+ fn pop(&mut self, op1: T);
+}
+
/// Trait for [`push`](https://www.felixcloutier.com/x86/push) instruction kinds.
pub trait Push<T> {
/// Emit a push instruction.
fn push(&mut self, op1: T);
}
-/// Trait for [`pop`](https://www.felixcloutier.com/x86/pop) instruction kinds.
-pub trait Pop<T> {
- /// Emit a pop instruction.
- fn pop(&mut self, op1: T);
+/// Trait for [`sub`](https://www.felixcloutier.com/x86/sub) instruction kinds.
+pub trait Sub<T, U> {
+ /// Emit an sub instruction.
+ fn sub(&mut self, op1: T, op2: U);
}
/// Trait for [`test`](https://www.felixcloutier.com/x86/test) instruction kinds.